January 03, 2010

Rsync Examples

« Mysql New User | Main | Spring scope »

Directory or file synchronization is a relevant topic at IT industry. The most important use case are backups. The rsync command is an Open Source tool for synchronization. It will be used often at Linux distributions or Unix derivatives. Furthermore the administrator can synchronize files to local or remote directories. The following commands describes the usage:

#synchronize directory incremental (-r) to another local directory
rsync -r -v /home/rafsob/images /backups/images

#synchronize directory incremental (-r) to another remote directory via ssh
rsync -r -v /home/rafsob/images root@developers-blog.org:/var/ftp/images

#"-a" option defines the archiv mode
#ensures that  symbolic links, attributes, ownerships, and so on will be preserved
rsync -r -a -v /home/rafsob/images /backups/images

Regards
Rafael Sobek

Technorati Tags:

Posted by rafael.sobek at 7:12 PM in Linux

 

[Trackback URL for this entry]

Pingback: Rsync Examples « Drakz Programming News Station at Mo, 4 Jan 10:50 AM

Rsync Examples
Examples Developers Blog - Programming Languages , Technologies and Visions. Read this article: Rsync Examples Tags:

Comment: DiscDev at Do, 9 Sep 12:08 AM

I put together an example of where to use rsync to sync your SVN repository to your website when they are on different servers:

http://discdev.com/2010/09/08/how-to-sync-your-svn-repository-to-your-website-when-they-are-on-different-servers/

Comment: error at Di, 28 Dez 7:37 AM

In the last example the -r option is redundant. It is inclosed in -a.

When you miss the / as last character in the source a new directory "images" would be created (/backups/images/images)...

Your comment:

(not displayed)
 
 
 

Live Comment Preview: