Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 886 Bytes

rsync.md

File metadata and controls

32 lines (22 loc) · 886 Bytes

RSYNC

References

Copy and delete old

    rsync -avl --delete --progress <source> <dest>  # Linux only

rsync through ssh tunnel

    # tunner rsync through ssh port 12345
    rsync -avl --delete -e 'ssh -p 12345' <source> user@192.168.10.1:<dest>

rsync with partial and exclude

    rsync -avzhP --delete --stats --log-file=backup.log --exclude-from 'exclude.txt' -e 'ssh -p 12345' <source> user@192.168.10.1:<dest>

Show progress

    rsync -avl --info=progress2 source dest  # Linux only
    export SOURCE=<source> DEST=<dest> && export SC=$(find "$SOURCE" | wc -l) rsy&& rsync -vrltd  --stats --human-readable "$SOURCE" "$DEST" | pv -lep -s $SC > /dev/null