Skip to main content

A status/progress bar for rsync.

Project description

rsyncy

A status/progress bar for rsync.

I love rsync but I always felt it was either too chatty when transferring lots of small files or did not show enough information for the large files in between. rsyncy is a wrapper to change this without having to modify rsync.

gif of rsyncy -a a/ b

Status Bar

[########################::::::]  80% |      19.17G |      86.65MB/s | 0:03:18 | #306 | scan 46% (2410)\

The status bar shows the following information:

Description Sample
Progress bar with percentage of the total transfer [########################::::::] 80%
Bytes transferred 19.17G
Transfer speed 86.65MB/s
Elapsed time since starting rsync 0:03:18
Number of files transferred #306
Files to scan/check
- percentage completed
- (number of files)
- spinner
scan 46% (2410)\

The spinner indicates that rsync is still checking if files need to be updated. Until this process completes the progress bar may decrease as new files are found.

Limitations

Interactive ssh questions (host key, password) are happening outside of the piped content. That means that rsyncy does not know that ssh is waiting for input and will draw the status bar over it. If you have an idea on how to handle this case please let me know.

Workaround: connect once to your server via ssh to add it to the known_hosts file.

Installation

pip3 install --user rsyncy

# or if you have pipx
pipx install rsyncy

Minimum Python version is 3.6.

On macOS you also need to brew install rsync because it ships with an rsync from 2006.

Usage

rsyncy is a wrapper around rsync.

  • You run rsyncy with the same arguments as it will pass them to rsync internally.
  • Do not specify any --info arguments, rsyncy will automatically add --info=progress2 and -hv internally.
# simple example
$ rsyncy -a FROM/ TO

Alternatively you can pipe the output from rsync to rsyncy (in which case you need to specify --info=progress2 -hv yourself).

$ rsync -a --info=progress2 -hv FROM/ TO | rsyncy

At the moment rsyncy itself has only one option, you can turn off colors via the NO_COLOR=1 environment variable.

lf support

rsyncy-stat can be used to view only the status output on lf (or similar terminal file managers).

Example:

cmd paste-rsync %{{
    opt="$@"
    set -- $(cat ~/.local/share/lf/files)
    mode="$1"; shift
    case "$mode" in
        copy) rsyncy-stat -rltphv $opt "$@" . ;;
        move) mv -- "$@" .; lf -remote "send clear" ;;
    esac
}}

This shows the copy progress in the > line while rsync is running.

Development

First record an rsync transfer with pipevcr, then replay it to rsyncy when debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsyncy-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file rsyncy-0.2.0.tar.gz.

File metadata

  • Download URL: rsyncy-0.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for rsyncy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8c95c4b1b449582de860366d9c201d4f3f8fce7efec155449dfd21ffed637fa
MD5 8ce2ce2cee4ad56e915c61eda085e59d
BLAKE2b-256 1a99145bb1c2fb5cb3e12917f23adc381739afe037939b444f132027368848cb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page