Skip to main content
https://travis-ci.org/guettli/compare-with-remote.svg?branch=master

compare-with-remote

Compare local files with remote files

About

This is a generic file comparing tool. I wrote it to help the transition from “pet to cattle”. With other words I am switching from linux server managed with vi and ssh to configuration management.

It helps you to compare files on a remote host with files on your local file system.

Install

pip install -e git+https://github.com/guettli/compare-with-remote.git#egg=compare-with-remote

Usage

===> compare-with-remote -h
usage: compare-with-remote [-h]
                           [--only-files-containing-pattern ONLY_FILES_CONTAINING_PATTERN]
                           directory_url_one directory_url_two

compare two directories. Directories can get fetched via ssh first, then
"meld" get called to copmare the directories. See https://github.com/guettli
/compare-with-remote

positional arguments:
  directory_url_one     [[user@]remote-host:]dir
  directory_url_two     [[user@]remote-host:]dir

optional arguments:
  -h, --help            show this help message and exit
  --only-files-containing-pattern ONLY_FILES_CONTAINING_PATTERN

Examples

You want to compare all files in the /etc directory which contain the word “rsyslog”:

root@local-server> compare-with-remote --only-files-containing-pattern rsyslog \
                                          root@server-with-cute-name-1:/etc \
                                          root@server-with-cute-name-2:/etc

You can compare the output of scripts like this:

root@local-server> compare-with-remote \
    'postgres@server-with-cute-name-1:psql -c "select app, name from django_migrations order by id"' \
    'postgres@server-with-cute-name-2:'

If you don’t provide a remote-command for the second host, then the command from the first host will get called. In this case all rows of a database table get compared.

Screenshots

After fetching the files, the script calls the tool “meld” to show the actual diff:

https://github.com/guettli/compare-with-remote/blob/master/docs/screenshot-of-meld-compare-directory.png

Here is a screenshot of meld showing the difference between two files:

https://github.com/guettli/compare-with-remote/blob/master/docs/screenshot-of-meld-compare-file.png

Don’t be shy

I want to know what you think and feel. Please leave a comment via the github issue tracker. I love feedback.

Release files for compare-with-remote 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compare-with-remote 0.12.0
File Size Uploaded
compare-with-remote-0.12.0.tar.gz 4.6 kB Details

Release files / compare-with-remote-0.12.0.tar.gz

Download URL compare-with-remote-0.12.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
459bb3c36f361838ce9c5c430cb2756ed4f21d1fe22c93199858e9c76931801e
BLAKE2b-256 checksum
How to use checksums
2219623767ec3900ff73a510c84ab7e8116fe4e4a47c9b1e7a72d5ed563384c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.12.0 This release

1 release file

0.10.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page