From 57e2b388febc1de5f784cdbbb9e6656fc7f8adc0 Mon Sep 17 00:00:00 2001 From: James Zhu Date: Thu, 9 Oct 2014 10:05:46 +0800 Subject: [PATCH] mod --- : | 12 ++++++++++++ cheat/cheatsheets/rsync | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 : diff --git a/: b/: new file mode 100644 index 0000000..a41afb9 --- /dev/null +++ b/: @@ -0,0 +1,12 @@ +# copy files from remote to local, maintaining file propertires and sym-links (-a), zipping for faster transfer (-z), verbose (-v). +rsync -avz host:file1 :file1 /dest/ +rsync -avz /source host:/dest + +# Copy files using checksum (-c), rather than time, to detect if the file has changed. (Useful for validating backups). +rsync -avc /source/ /dest/ + +# Copy contents of /src/foo to destination: +# for below command, If doesn't specify the destination foo, then it will create foo in /dest +rsync -auv /src/foo /dest +# for below command, It will copy the contents of /src/foo/ to /dest/foo +rsync -auv /src/foo/ /dest/foo diff --git a/cheat/cheatsheets/rsync b/cheat/cheatsheets/rsync index 617bf74..a41afb9 100644 --- a/cheat/cheatsheets/rsync +++ b/cheat/cheatsheets/rsync @@ -4,3 +4,9 @@ rsync -avz /source host:/dest # Copy files using checksum (-c), rather than time, to detect if the file has changed. (Useful for validating backups). rsync -avc /source/ /dest/ + +# Copy contents of /src/foo to destination: +# for below command, If doesn't specify the destination foo, then it will create foo in /dest +rsync -auv /src/foo /dest +# for below command, It will copy the contents of /src/foo/ to /dest/foo +rsync -auv /src/foo/ /dest/foo