Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Yet another backup script solution UNIX
There are a few examples of backup schemes on MacOSXHints. In the spirit of giving something back, I thought I would share my backup scripts.

I back up all my user files to an external hard disk using RsyncX. You need to download and install this first. The advantage of this is that you syncronise between the data on your hard disk and the data on your external backup disk, so each time the script runs, you only copy accross any changed files. When I say "all my user files," I mean that I syncronise a copy of all directories under /Users

Copy this SyncUsers script to /usr/bin on your Mac (here's an executable version). The volume to back up to is represented by the variable EXTDISK in the backup script. In my case, DataFormac. Change this to the volume name you want to backup to. The script should be executed via sudo to insure that all users can be archived, and so that mdutil works. To run the script, just type sudo SyncUsers in a terminal window.

I've worked in the computer industry a while, and have seen a few disasters. Because of this, I'm overly cautious. Every month I take a copy of my external FireWire backup disk to another disk and store it "offsite" (which in fact means in my desk at work!). This is done with a second script called Offsite (here's the executable version).

Copy the script to /usr/bin on your Mac and then again you need to change the name of some disk volumes in the script. The disk that the script copies from (the volume you run SyncUsers to) is stored in the SYNCDISK variable. The disk volume that you will copy to is in the variable EXTDISK. Now be aware, the script will erase the volume (EXTDISK) and then take a copy of your backup volume using ditto. Again, this script should be run using sudo.

[robg adds: I haven't tested these scripts.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[12,897 views]  

Yet another backup script solution | 12 comments | Create New Account
Click here to return to the 'Yet another backup script solution' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yet another backup script solution
Authored by: ChrisRyland on Jun 07, '06 08:09:42AM

Note that all of the known rsync's (including RsyncX) have various (some of them serious) flaws, which is not what you want to have in a backup program.

Because of this, I'd stronlgy recommend using SuperDuper! for all backup tasks. (It also has a "smart copy" mode that only copies changed files.)

---

Cheers!
--Chris Ryland, Em Software



[ Reply to This | # ]
SuperDuper?
Authored by: rsnyder on Jun 07, '06 08:41:22AM

Does SuperDuper! offer command line toots? I use IBM's Tivoli Storage Manager (TSM) and really value the CL interface. Setting up cron jobs makes it much more of a "set it and forget it" solution for me.

One of the things I do with my servers and some of my desktops is to have them back up using rdiff to a central server with an Xsan. This gives me near-line backup. Then I use TSM to run daily (hourly on some directories) backups of the near-line storage.

Would SuperDuper! fit in to that scenario? What would be the benefit of switching to SuperDuper!



[ Reply to This | # ]
SuperDuper has scheduling built-in
Authored by: Krioni on Jun 07, '06 10:10:03AM

SuperDuper has scheduling built-in, so it sounds like it could work in your situation. The developer is also very responsive to questions/problems.

SuperDuper is definitely worth it.

---
--
http://www.danshockley.com



[ Reply to This | # ]
SuperDuper?
Authored by: luomat on Jun 07, '06 10:49:14AM
Does SuperDuper! offer command line toots? I use IBM's Tivoli Storage Manager (TSM) and really value the CL interface. Setting up cron jobs makes it much more of a "set it and forget it" solution for me.

No, but it sounds like what you want is automation, and SuperDuper does have its own built in scheduling which works just fine (as long as you remember to have the drive connected, which is the only time it fails to work for me).

One of the things I do with my servers and some of my desktops is to have them back up using rdiff to a central server with an Xsan. This gives me near-line backup. Then I use TSM to run daily (hourly on some directories) backups of the near-line storage.

Would SuperDuper! fit in to that scenario? What would be the benefit of switching to SuperDuper!

SD's implementation is superior than cron because it is easier to use. However I think it will limit you to once a day backups.

However, the only maxim still applies: if it ain't broke, don't fix it. If your setup is working for you, why change it?

SD can automatically run scripts before and after it is run. I use one of these to unmount the drive before SD tells the computer to sleep.

I wrote this tip on how to implement that

http://www.macosxhints.com/article.php?story=20060511125715782&lsrc=osxh



[ Reply to This | # ]
SuperDuper?
Authored by: sjk on Jun 07, '06 03:56:28PM
SD's implementation is superior than cron because it is easier to use.
The SD! scheduler is a GUI for managing cron entries that run scheduled backups. So, it's not really superior to something it uses. :-)
However I think it will limit you to once a day backups.
You can schedule multiple backups per day.

[ Reply to This | # ]
Yet another backup script solution
Authored by: vykor on Jun 07, '06 09:15:35AM

There's a caveat with ditto. Despite its attempt to preserve metadata, it actually fails to preserve creation dates. If you're in a position where file creation date is important, you should consider make your backups with something else or have the driver script note and restore the proper dates as it executes.



[ Reply to This | # ]
sync is not backup
Authored by: adrianm on Jun 07, '06 10:46:19AM
This script does an rsync --delete which means that the destination will be a synchronised copy of the source.

So if you screw up your local copy and then 'back it up' in this way, you'll just end up with a screwed up copy on your external drive.

Granted, the poster says he makes another copy periodically, but I think it's worth pointing out that synchronising is not the same as backing up.

What I often do is rsync my files to a directory containing the day of the week, so I end up with 7 synchronised copies.... At least then I have 7 days to notice :-)

[ Reply to This | # ]

sync with backup!
Authored by: Jimbo MF on Jun 07, '06 11:24:25AM
Take a look at ChronoSync. http://www.econtechnologies.com
This is pretty simular to Super-Duper
It does however have an archive function.
This will keep a user definable number of old copies of files instead of overwriting and loosing them.

I find it very handy.

James

[ Reply to This | # ]
Another backup solution
Authored by: visionaut on Jun 07, '06 12:06:03PM

For a non-scripted, non-terminal method of backup, which supports incremental backup/restore, comparison & synchronization; scheduling, and logging features; ownership and permissions; and flexible, user-selectable volume/directory (and exclusion) target & destination capabilities (incl network drives) -- I strongly suggest the freeware tool from LaCie called SilverKeeper.

Very easy to use, nice documentation/help system. I'm a very satisfied user and have tried many other solutions (command line tools and third-party utilities). Give it a look! (No requirement to have/use LaCie drives. I have no affiliation with LaCie.).

[http://www.silverkeeper.com]



[ Reply to This | # ]
Comparison of backup tools
Authored by: moritzh on Jun 07, '06 05:39:44PM
There is an excellent summary of which drawbacks different backup tools such as rsyncx have, mainly with respect to conserving metadata (creation date, Finder comments, ...) on plasticsfuture.org.

[ Reply to This | # ]
Yet another backup script solution
Authored by: luomat on Jun 12, '06 05:01:26PM
SD's implementation is superior than cron because it is easier to use.
The SD! scheduler is a GUI for managing cron entries that run scheduled backups. So, it's not really superior to something it uses. :-)

Actually I find SD!'s scheduler much more superior because it is easier to use. Who wouldn't rather check boxes for day of the week than try to remember which column is for day and which is for month? And is "3" Tuesday or Wednesday?

So SD!'s scheduler can be superior to something it uses the same way clicking "Send" in Mail.app (or any mail program) is easier than telnetting to the SMTP server and manually communicating with it.



[ Reply to This | # ]
Yet another backup script solution
Authored by: sjk on Jun 12, '06 11:33:23PM
You originally said SD!'s implementation is superior to cron, not that SD!'s scheduler UI is easier to use for managing cron entries than editing them more directly without it. It sounded like you were saying SD! was a superior replacement for cron itself.

Same as clicking "Send" in Mail doesn't make it superior to (or a replacement for) SMTP; that just makes it easier to use SMTP than the telnet method you described.

Anyway, we're agreeing even if we say it differently. :-)

[ Reply to This | # ]