Tuesday, April 5, 2011

Linux equivalent to robocopy

robocopy /s src dest
rsync -av src/ dest

robocopy /mir src dest
rsync -av --delete src/ dest

robocopy /mir /z src dest     (restartable mode)
rsync -avhP --delete --append src/ dest

robocopy /mir src/sub1 dest/sub1

rsync -av --delete src/sub1/ dest/sub1
or
rsync -av --delete src/sub1 dest

From rsync command help:-

A trailing slash on the source can be used to avoid creating an additional directory level at the destination.

-a, --archive      archive mode; equals -rlptgoD

    --append       append data onto shorter files
-h                 output numbers in a human-readable format
-P                 same as --partial --progress
    --partial      keep partially transferred files
    --progress     show progress during transfer
-v, --verbose      increase verbosity
    --delete       delete extraneous files from destination dirs

-r, --recursive    recurse into directories
-l, --links        copy symlinks as symlinks
-p, --perms        preserve permissions
-t, --times        preserve modification times
-g, --group        preserve group
-o, --owner        preserve owner (super-user only)
-D                 same as --devices --specials
    --devices      preserve device files (super-user only)
    --specials     preserve special files


See also
rsync to NAS (Windows SMB)

No comments:

Post a Comment