Tag Archives: rsync

Rsync – exclude

>> Exclude .txt files [! CASE SENSITIVE]
$ rsync -avz --exclude '*.txt' source/ destination/

>> Exclude from file list
$cat exclude-list.txt 
*.JPG
*.TMP
*.PDF
*.jpg
*.tmp
*.pdf
*.zip
relative/path1/
relative/path2/

$ rsync -avz --exclude-from 'exclude-list.txt' /source/path/ /dest/path/ | tee rsync-report.txt


>> Exclude directory 
$ rsync -avz --exclude 'folder1_within_source' --exclude 'folder2_within_source/subfolder2' source/ destination/

 

Linux Cloud Server migration script

This script allows you to migrate a Linux Server from one server to another one. It uses rsync and it could be use when you need to resize down a server for example, or if you want to migrate onto another Cloud Provider.

git clone git://github.com/cloudnull/InstanceSync.git

Source:
http://cloudnull.io/2012/07/cloud-server-migration/
https://github.com/cloudnull/InstanceSync

Mac – Upgrade rsync to version 3

Quick method:

change /private/etc/paths putting ahead /usr/local/...

<span style="color: #ff0000;">/usr/local/bin</span>
<span style="color: #ff0000;">/usr/local/sbin</span>
/bin
/usr/bin
/usr/sbin
/sbin

Then, unzip this precompiled rsync into /usr/local/bin

Restart the Terminal and run

rsync --version

This should be the output:

rsync version <span style="color: #ff0000;">3.0.9</span> protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes