Common rsync commandline
I find myself calling rsync with the following parameters quite often to synchronize my working directory with a server:
rsync -az --no-o --no-g --progress . user@host:/target/path
Explanation:
- Synchronizes current directory with
/target/path
on the remote host -
-a
"archive mode" (recurse into directories, copy symlinks as symlinks, preserve permissions, preserve modification times, transfer special files, preserve group and owner of files;equals to a whole pack of options-rlptgoD
) -
--no-o
and--no-g
remove theo
andg
options that preserve owner and group of files (you probably have different users and groups on different machines) -
--progress
output some progress information on each file being transferred (this option also implies--verbose
) -
-z
compress files during transfer (you may want to omit this if you transmit lots of binary files)
Written by Dmitry Pashkevich
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#