Difference between revisions of "Backing up documents using rsync"

From Notes_Wiki
m
m
 
Line 1: Line 1:
<yambe:breadcrumb self="Backing up documents using rsync">Rsync|Rsync</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Rsync]] > [[Backing up documents using rsync]]
=Backing up documents using rsync=


'''More updated article on this is at [[CentOS 8.x Copying or backup of documents using rsync]]'''
'''More updated article on this is at [[CentOS 8.x Copying or backup of documents using rsync]]'''
Line 22: Line 21:
*-n to cause rsync to perform dry run and not do any changes. ''It is very useful if you want to use --delete option''
*-n to cause rsync to perform dry run and not do any changes. ''It is very useful if you want to use --delete option''
*-L to cause following of symbolic link dirs as if they are real dirs and make their copy also on destination.
*-L to cause following of symbolic link dirs as if they are real dirs and make their copy also on destination.
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Rsync]] > [[Backing up documents using rsync]]

Latest revision as of 14:53, 24 August 2022

Home > CentOS > CentOS 6.x > Rsync > Backing up documents using rsync

More updated article on this is at CentOS 8.x Copying or backup of documents using rsync

We can backup entire documents from one machine to another using syntax like:

rsync -vtrp --partial --delete --ignore-errors saurabh@10.5.1.222:/documents/ /documents/

Here:

  • -v is for verbose
  • -t is for copying timestamps
  • -r is for recursion
  • -p is for permissions
  • --partial is so that partial files are not deleted. Note that using --partial is better than using --inplace because of the diff algorithm and it also allows destination file to always be in consistent state.
  • --delete to delete files on destination that are not present on source. Careful
  • --ignore-errors to ignore errors occurred during copying. This may be because of root owned folders like lost+found in source dir. Use with caution


Apart from above options other useful options to consider are:

  • --progress to see progress of file being copied if you are copying big files like movies, etc.
  • -n to cause rsync to perform dry run and not do any changes. It is very useful if you want to use --delete option
  • -L to cause following of symbolic link dirs as if they are real dirs and make their copy also on destination.



Home > CentOS > CentOS 6.x > Rsync > Backing up documents using rsync