Rsync – A quick overview

Some people may have noticed in my tutorial on how to create a new /home partition that I used Rsync to copy the home data.
Rsync is in short a tool that can be used to keep directories in sync either locally or remotely. It only copies new or modified files since the last time instead of re-copying all the files for this reason I find it am excellent backup tool which most linux distrobutions have it. There is even a GUI tool that can be installed called Grsync.
Rsync has a lot of options , too many to write here. From the command line you can always man rsync to list more options but here are some common options that can be used.
-a archive mode
-E preserve the executable conditions of regular files
-h human readable
-p preserve permissions
-r recursive
-v increase verbosity , use -vv an it will output more information
-z use compression whilst transferring
As you can see in my tutorial on how to create a new /home after you’ve installed is used the command rsync -arv /home/* /mnt/home , as you can see it used archive mode , recursive and was verbose , but didnt output to much information. So as you can see the command is
rsync -(option(s)) /source /destination
That is a good example of syncing two folder locally , however it can be done over a network to a remote server. It uses the SSH protocols , so you will need to have ssh setup. To do this the command is
rsync -(option(s)) /source user@ip.address:/path/to/destination
*It is important to not that the user has read/write access to the destination
Another useful example is on how to use the * wildcard , extremely useful if like me you use a different folder for iso’s , pictures and music etc.
rsync -(option(s)) /source/*.iso /path/isos/
As you can see there is a lot of possibililies that can be done with rsync even with the options I have talked about there are a lot more that can be chosen from , but I find these are the more common options. So when using rsync think about what you want copied and where and how you want to copy it.
For those who are wondering , yes , this process can be automated, however im not going into that in this overview. In the future if I get enough people asking me about this I will make a tutorial on how to do this

Tagged with:
Posted in 01Ben, Uncategorized
One comment on “Rsync – A quick overview
  1. […] ~/Documents for example. Personally I use and recommend rsync, I have previously written about it here. To backup my home folder using rsync I would use rsync -arvvp ~/ /mnt/Storage/Backup To create a […]

Please feel free to leave a reply.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Enter your email address to follow this blog and receive notifications of new posts by email.

Join 67 other followers

%d bloggers like this: