Show Password


OS X (Apple)

OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.

Rsync for back up, external HD

backups, options, rsync

👤 Login to reply

Thread Tools Search this Thread Display Modes
Old 06-26-2013
marek marek is offline
Registered User
Join Date: Jun 2013
Last Activity: 3 July 2017, 3:58 PM EDT
Posts: 26
Thanks: 6
Thanked 0 Times in 0 Posts
Thank you xbin!

I did not know the asr command! Interesting! I already did install the latest version of rsync, but did not succeeded to apply the patches. Will dip in again one more time. And thank you for the link!

Sponsored Links
Old 07-07-2013
marek marek is offline
Registered User
Join Date: Jun 2013
Last Activity: 3 July 2017, 3:58 PM EDT
Posts: 26
Thanks: 6
Thanked 0 Times in 0 Posts
Hello all!

rsync version: 3.0.9
MacOSX: 10.8.4
Subject: make an exact copy of HD to an external HD with rsync

After long tests I put up my rsync script like follows:

First a long exclude file, which is read in by rsync with the switch


in this file are some legacy files from old MacOSes. So this exclude file should also work for older Macs. But probably not with an older rsync version ...

The following exclude file is from: Some files and folders are automatically excluded from a backup task / Backup and archiving settings / Knowledge Base - Bombich Software Support

.HFS+ Private Directory Data*
Saved Application State
/Library/Application Support/Comodo/AntiVirus/Quarantine

Contrary to Slicehost Articles: rsync - exclude files and folders I found, that spaces and wild cards "*" don't need to escaped with "[ ]" (for spaces) or surrounded by quotes like "file*" for wild cards. And "/" means root folder - as expected -, not the folder from were the script was started.

Here the rules for this exclude files: every excluded file or folder has to be separated by a line.

Suppose, we have following folders, with some contents:


dev # backups the folders "#dev" and "dev#", but not "dev"
*dev/ # backups the folder "dev#" and nothing else!
dev/ # backups the folders "#dev" and "dev#"
dev/* # backups the folders "#dev" and "dev#" with its contents and the folder "dev" without
*dev/* # backups an empty "#dev" and "dev" and "dev#" with contents.
dev*/ # backups "#dev" with contents.
*dev*/ # nothing ...
*dev*/* # empty folders: "dev", "#dev", "dev#"

And now the backup script, which you start with, being in the folder where you saved this script:

sudo ./rsync.sh



OPTS="-tavu --exclude-from=$EXCLUDES --delete"


if ls /Volumes/ | grep -q $EXTERN; then
	echo "$EXTERN is mounted! Starting backup ...\n"
	echo "Please mount the external HD \"$EXTERN\" before running this script!"

rsync $OPTS / $USBDisk

Hope this helps some people out there ...

Sponsored Links
Old 07-08-2013
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Join Date: Sep 2005
Last Activity: 16 July 2018, 9:56 AM EDT
Location: Switzerland - GE
Posts: 6,550
Thanks: 311
Thanked 564 Times in 526 Posts
Thanks for your contribution
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bash script to back up with rsync ajmoreti Shell Programming and Scripting 3 11-16-2009 05:36 AM
Back-to-Back Connection using HBAs aldowsary IP Networking 3 11-28-2008 09:21 PM
Rsync to an external list of URLs ibsen Shell Programming and Scripting 8 10-06-2008 07:33 PM
rsync back? redlotus72 UNIX for Dummies Questions & Answers 1 09-22-2005 03:43 PM

All times are GMT -4. The time now is 02:17 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.