Personal tools
You are here: Home PopNet Help: Using PRI's Networks Unix/Linux Unix rsync command

Unix rsync command

Alternative to cp

        rsync -HAaux --delete --progress <dir1>/ <dir2>

  where you can prepend either <dir1> or <dir2> with a prepending
  "<host>:" spec for remote rsync(1)...
  the above will maintain hard links, ACLs, and such...
  i guess i should actually run down the flags to give you some

        -H -            preserve hard links
        -A -            preserve ACLs
        -a -            archive (i.e. preserve most other stuf and do
                        a recursive copy)
        -u -            update-only, do not overwrite newer files
        -x -            one filesystem (which implies NOT following symbolic
                        links in the copy)
        --delete -      prune (delete files in the destination that
                        don't exist in the source, so you won't want
                        to use this flag if other products are already
        --progress -    show you what's happening in a meaningful way

  and... perhaps the most important thing to remember is to always
  add the trailing slash to the source (but not the dest) directory...
  as that indicates you want to sync the actual absolute locations,
  instead of making a copy of the source INSIDE the dest...

rsync(1) is more powerful than cp(1) and it uses  SSL-encryption (via SSH) for any data transfers over a network.

Document Actions

Copyright ©2014, The Pennsylvania State University | Privacy and Legal Statements
Contact the Help Site Administrator | Last modified Jan 28, 2013 | Weblion Partner