Skip to content

Instantly share code, notes, and snippets.

@stepheneb
Created January 28, 2011 04:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stepheneb/799853 to your computer and use it in GitHub Desktop.
Save stepheneb/799853 to your computer and use it in GitHub Desktop.
# first recursive copy of external dir using rsync
$ rsync -avx --delete otto.concord.org:/web/xproject.dev.concord.org/current/public/system/attachments/ attachments
receiving file list ... done
created directory attachments
./
10/
10/original/
10/original/GenePool6.exe
13/
13/original/
13/original/profile-logo.png
15/
15/original/
15/original/git-book.pdf
16/
16/original/
16/original/Newtons_Cannon.v5.nlogo
5/
5/original/
5/original/profile-logo.png
9/
9/original/
9/original/GenePool6.zip
sent 230 bytes received 1311910 bytes 201867.69 bytes/sec
total size is 1310944 speedup is 1.00
# second copy takes very little time, only 460 bytes transferred
$ rsync -avx --delete otto.concord.org:/web/xproject.dev.concord.org/current/public/system/attachments/ attachments
receiving file list ... done
sent 20 bytes received 460 bytes 192.00 bytes/sec
total size is 1310944 speedup is 2731.13
# Create an extra file in the destination directory
$ touch attachments/extrafile
$ ls -als attachments/
total 0
0 drwxrwxr-x 9 stephen _lpoperator 306 Jan 27 23:58 .
0 drwxr-xr-x 189 stephen staff 6426 Jan 27 23:58 ..
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 17:27 10
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 20 09:51 13
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 20 21:05 15
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 27 10:31 16
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 16:23 5
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 17:27 9
0 -rw-r--r-- 1 stephen _lpoperator 0 Jan 27 23:58 extrafile
# run rsynch again
$ rsync -avx --delete otto.concord.org:/web/xproject.dev.concord.org/current/public/system/attachments/ attachments
receiving file list ... done
deleting extrafile
./
sent 26 bytes received 466 bytes 328.00 bytes/sec
total size is 1310944 speedup is 2664.52
# the extra file is gone
$ ls -als attachments/
total 0
0 drwxrwxr-x 8 stephen _lpoperator 272 Jan 27 10:31 .
0 drwxr-xr-x 189 stephen staff 6426 Jan 27 23:58 ..
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 17:27 10
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 20 09:51 13
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 20 21:05 15
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 27 10:31 16
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 16:23 5
0 drwxrwxr-x 3 stephen _lpoperator 102 Jan 19 17:27 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment