PDA

View Full Version : [all variants] Backup with rsync



nhpropwn
October 9th, 2012, 11:51 AM
Hi guys,
I want to make backup of files/directories and then restore it removing all present changes and new files and directories.

example: make /home backup and after time restore how it was before

How can I do it with command line: rsync, cp or with stomething else

Sorry for my english :(

NikTh
October 9th, 2012, 12:11 PM
Hi ,

with rsync


rsync -aS <target directory> <destination directory>Parameters -a -S
from man rsync

-a = archive mode ; equals to -r # means recursively
-S = handle sparse files efficientlyabove command will effectively copy ALL your files from "target directory" (including hidden files-configuration files) to the "destination directory" .
Command is reversible for restore , although some users including other parameters for restore such
--ignore-existing = skip updating files that exist on receiverTake a look in manual page
man rsync and make some tests (in a testing folder) .

Thanks

Lars Noodén
October 9th, 2012, 02:33 PM
There are some examples here:

https://help.ubuntu.com/community/rsync

centaurusa
October 9th, 2012, 02:58 PM
I want to make backup of files/directories and then restore it removing all present changes and new files and directories.

How can I do it with command line: rsync, cp or with something else


Take a look at Back In Time which is a graphical front end for rsync and works extremely well. See, for example:

http://linuxnorth.wordpress.com/2012/03/12/back-to-the-future/