User Tools

Site Tools


tutorials:rsync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:rsync [2012/06/15 01:11] chkuotutorials:rsync [2012/06/15 01:18] (current) chkuo
Line 6: Line 6:
 <code bash> <code bash>
 rsync -av --delete ~/active_project oak.local:~ rsync -av --delete ~/active_project oak.local:~
-</bash>+</code>
  
 Alternatively, if I want to copy only the files that have been changed in ''/scratch/chkuo/spiro1.02'' directory on the server (oak.local again) back to my local workstation, I can use: Alternatively, if I want to copy only the files that have been changed in ''/scratch/chkuo/spiro1.02'' directory on the server (oak.local again) back to my local workstation, I can use:
 <code bash> <code bash>
 rsync -av --delete oak.local:/scratch/chkuo/spiro1.02 /scratch/chkuo rsync -av --delete oak.local:/scratch/chkuo/spiro1.02 /scratch/chkuo
-</bash>+</code>
  
-This better than using ''scp'' because ''rsync'' can skip files that already exist in the destination and have not been updated in the source.+This is better than using ''scp'' because ''rsync'' can skip files that already exist in the destination and have not been updated in the source
 + 
 +It is **important** to note that the absence or presence of the trailing slash at the end of the source directory (i.e., ''~/active_project'' versus ''~/active_project/'') have different effects, so be careful.
  
 ===== Advanced uses ===== ===== Advanced uses =====
-If we need to sync some directories quite often (like the ~/active_project'' example above), it is easier to save the command in a schell script and place the script somewhere in the search path (''~/bin'' or ''~/script'' for example, see [[tutorials:bash|.bashrc]] for more info). +If we need to sync some directories quite often (like the ''~/active_project'' example above), it is easier to save the command in a schell script and place the script somewhere in the search path (''~/bin'' or ''~/script'' for example, see [[tutorials:bash|.bashrc]] for more info).
- +
  
  
tutorials/rsync.1339693909.txt.gz · Last modified: by chkuo