Today we are going to take a look at backing up files in Linux using RSync. RSync will come already installed on almost every Linux distribution so you will not need to install it.
The basic syntax is:
rsync /home/user/dir /media/disk/dir
Lets explain this with an example. If I wanted to back up my entire home directory to an external hard drive called sdc mounted in media I would type the following:
rsync /home /media/sdc
Now there are various switches we can use with rsync and the main ones are outlined below:
-a archive. This preserves, among other things, the owner, group and permissions of the directory / file.
-h hardlinks. This switch will preserve all hardlinks to the directory /file.
-v verbose mode. This switch tells Rsync to inform us what it is doing when performing the backup.
– exclude. This will allow us to exclude certain files / directories from being backed up e.g –exclude ‘home/user/dir.
So using the switches our example would look like:
rsync -avh –exclude ‘home/chris/documents’ /home /media/sdc
For people who don’t like using the command line there is a program called GRsync which provides a GUI for using RSync.
About the Author
Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.
For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more.
Thanks for all your valuable efforts on this website. Kate really likes managing internet research and it is easy to see why. My partner and i learn all regarding the lively manner you deliver priceless solutions through the web blog and as well boost participation from the others on that subject plus our favorite princess is always learning a lot of things. Have fun with the remaining portion of the new year. You are performing a great job.
Quality post, I will be browsing back more often to find fresh news.
Actually difficult to get qualified persons with this topic, you seem like you know exactly what you are referring to! Thx