Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jun 082010
 

How to ignore dummy files (e.g. from CVS, SVN) during rsync?

Answer:

During rsync, you might want to ignore a lot of dummy files, e.g. .bak, .svn, .old files, you can use the following flag as part of your rsync command.

# rsync --cvs-exclude ...

List of files skipped (rsync 3.06):

RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .bzr/

Dec 312009
 

How to mirror a directory to a remote server over SSH?

Answer:

You can use rsync command for this purpose

Assume you want to mirror the local folder "/home/john" to remote server 192.168.1.5, under the folder "/data/backup/", you need to use the following command

rsync -avuz -e ssh /home/john 192.168.1.5:/data/backup/

If you want to dry-run the rsync, use the "n" flag, e.g.

rsync -avuzn -e ssh /home/john 192.168.1.5:/data/backup/

For more options, checkout the rsync document: http://www.samba.org/ftp/rsync/rsync.html