Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Resume broken scp/mc/fish transfer with rsync

    17th October 2013

    Note: this is a draft post back from 2010. As it is still useful to me, I’ve decided to publish it as is.

    I had already mused on the powers of rsync before.

    This time, a reminder to self on how to resume copying broken scp/mc/fish transfers, using rsync.

    First, an assortment of example commands.
    export RSYNC_RSH=ssh
    rsync --partial file_to_transfer user@remotehost:/path/remote_file
    rsync -av --partial --progress --inplace SRC DST
    rsync --partial --progress --rsh=ssh host:/work/source.tar.bz2 .
    rsync --partial --progress --rsh=ssh -r me@host.com:/datafiles/ ./

    One could also try the --append option of rsync to base the transfer resumption on the sizes of the two files rather than verifying that their contents match.

    Now a single command line explained in a little more details:
    rsync -vrPtz -e ssh host:/remote_path/* /local_path/
    Explained:
    -e ssh rsync will use ssh client instead of rsh, which makes data exchange encrypted
    -z compress file transfer
    -t preserve time (other attributes, such as owner and permissions are also possible)
    -P resume incomplete file transfer
    -r recurse into subdirectories
    -v verbose

    To specify a port when using ssh you must add it to the ssh command.
    Example: rsync --partial --progress --rsh="ssh -p 16703" user@host:path

    Share

    Posted in Notepad | No Comments »

    Harness the power of rsync

    6th July 2009

    I have read manpages of rsync today.
    I feel enlightened.

    I had a dream of rsync being one of the legendary nix Super-Cows.

    A tiny perversive part of self created a PDF version of rsync manpages (43 pages).

    It seems that Super-Cows can damage the brain, when stared at too intensely.

    Share

    Posted in *nix | 4 Comments »