Coder Social home page Coder Social logo

rsyncy's Introduction

rsyncy

A status/progress bar for 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.

Installation

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.

Known Issue when using ssh behind rsync

ssh uses direct TTY access to make sure that the input is indeed issued by an interactive keyboard user (for host keys and passwords). That means that rsyncy does not know that ssh is waiting for input and will draw the status bar over it. You can still enter your password and press enter to continue.

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

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.

If you have downloaded the binary version you can create it with ln -s rsyncy rsyncy-stat.

Development

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

rsyncy's People

Contributors

geeseven avatar laktak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rsyncy's Issues

on ubuntu 16.04 with python 3.5 error

I am on Ubuntu 16.04 running python3.5, after installing rsyncy
and running rsyncy -a /home/oub/ /media/oub/Linux2Mac/oub/
I obtain the following error:

 File "/home/oub/.local/bin/rsyncy", line 44
    return f"\033[{(30+col) if col<8 else (90-8+col)}m"

Not sure what to do

[Feature request] Option to disable colours

It would be nice if there was an option to disable the colours, or of it would at least respect the colours that I'm using.

I'm using the Solarized colours, and it doesn't look that good for me. :)

Thank you for an awesome piece of software!

How do I use this command in sudo

Hello,

I installed this package using pip3 in sudo so that it installed for root user. I then use the command with sudo and get that the command is not found. How do I do this correctly?

Thanks!

"Command not found"

Hello. I am a Linux newbie.

I successfully installed rsyncy and found it in ~/.local/bin. When I try to run the command, I get an error that "Command 'rsyncy' not found".

Thank you.

ctrl-C interrupting is broken: `rsync` returns exit status `20` to shell, but `rsyncy` returns no-error `0` ("SIGINT/SIGTERM/SIGHUP (code 20)")

When you interrupt plain rsync with ctrl-C, it prints an error message like:

rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(642) [sender=3.1.3]
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at io.c(504) [generator=3.1.3]

and indeed returns an exit status of 20 to the shell.

However, when you interrupt rsyncy,
it lets rsync print that same error message to the screen,
but returns the non-error exit status of 0 to the shell instead.


(
Sorry, this looks like something that's probably really easy to fix,
but I just don't know anywhere near enough about python to figure out the documentation for this.
(Also, sorry if I'm somehow asking in the wrong place; I'm kinda new to all this...)

I assume this I got from pip list is accurate:

Package             Version
rsyncy              0.1.0

and there's nothing relevantly weird or outdated about my specific copy.
)


Thanks!

ERROR - can't parse#1:

I am running rsyncy and getting the following error:

rsyncy -r -a -v /source/ /destination
ERROR - can't parse#1:

building file list ...
['building', 'file', 'list', '...']
invalid literal for int() with base 10: 'file'

Running the rsync command with the same arguments does not product any error.

Rsyncy use in lf file manager at bottom line problem

I would like to transfer the rsync copy routine of the lf file manager to this rsyncy, because I really like the progress bar and it is useful, but it does not want to work with the existing script, the progress bar is not visible on the bottom line. What can be the solution? I use the following script:

cmd paste &{{
    set -- $(cat ~/.local/share/lf/files)
    mode="$1"
    shift
    case "$mode" in
        copy)
            # rsync -ah --info=progress2 -- "$@" . |
            rsyncy -ah -- "$@" . |
            stdbuf -i0 -o0 -e0 tr '\r' '\n' |
            while IFS= read -r line; do
                lf -remote "send $id echo $line"
            done
            ;;
        move) mv -n -- "$@" .;;
    esac
    rm ~/.local/share/lf/files
    cd $PWD
    lf -remote "send clear"
    lf -remote "send load"
}}

doesn't work on mac

rsyncy -av Normal\ SSD [email protected]:/mnt/plex/backup_stuff
rsync: --info=progress2: unknown option
rsync error: syntax or usage error (code 1) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(1337) [client=2.6.9]

Support for arm64

Thank you for this project. Is it possible to add support for arm64? I wanted to install it on Raspberry PI but I wasn't successful.

It is not possible via APT:

...
# apt search rsyncy
Sorting... Done
Full Text Search... Done
rsyncy/unknown 0.2.0-1 amd64
  Status/progress bar for rsync
# apt install rsyncy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package rsyncy

And direct installation as well

# wget https://download.opensuse.org/repositories/home:/laktak/Debian_11/amd64/rsyncy_0.2.0-1_amd64.deb
...
# dpkg -i rsyncy_0.2.0-1_amd64.deb
dpkg: error processing archive rsyncy_0.2.0-1_amd64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 rsyncy_0.2.0-1_amd64.deb

error

rsyncy -arv --stats /home/iomari/downloads iomari:/temp/gittemp/
[::::::::::::::::::::::::::::::] 0% | 0 | | 0:05:08 | scan \
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(644) [sender=3.1.3]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.