|
|
hfspax and anacron
hfspax is a nice utility to archive HFS+ directories without losing resource forks or file attributes. Anacron is available via Fink, it basically runs programs every X days like cron does, except it doesn't depend on your computer always being on at the time the program is set to run.
This will backup your home folder: cd /UsersI like it more than ditto since it puts everything in one file, so I can gzip it after. Also, it lets you filter files. Since I know that all the MP3s in my Sound folder are already burned to CDs, I don't have to back them up: hfspax -wx cpio -s '|.*/Sound/.*.mp3||' -f /backup/destination.hfspax ~In case you're wondering, that's just a regex to turn "*/Sound/*.mp3" into an empty string, which tells pax I don't want it to be archived. I can restore by expanding the gzip archive, then running hfspax -r -pe -f vasi.hfspaxwhich preserves resource forks, permissions, everything. Another thing I find useful to do when backing up is to run cdThis gives you a nice list of all the files and directories in your home folder. You can use it to restore the entire directory structure (echo /some/file | xargs -0 mkdir -p), so even the things you filtered out of the hfspax archive still have a place to go when you restore them. You can also use it if you lose just a couple of files and only want to restore those. Just search throught the listing for the files you lost, so you know the exact names, and then use hfspax to extract just them. I have all this done in a script that runs automatically daily via anacron (does that make it a "zero step backup"? :-). One thing to be careful of when you back up is that you don't overwrite your backup location, like the backup system in this article does; if something goes wrong in the middle of the backup, you could be SOL. Instead, move the old backup, create the new backup, then if and only if that was successful delete the old one. Hope this helps someone! vasi
Is anacron what you want here?
it basically runs programs every X days like cron does, except it doesn't depend on your computer always being on at the time the program is set to run.
Er, of course this doesn't mean that anacron will run a backup when the computer isn't on... :-) I don't ever switch computers off, so I'm not entirely clear about the implications, but if I'm guessing right the difference with anacron is that when you switch on it will say: "Heaven's is that the time, I should have run this backup three hours ago", and start backing up right away. But this probably isn't what you want, is it? You've probably set your backup to run at 3.00am each night when there's a good chance you won't be using the machine -- you don't want backups running while you're actually creating and changing files in your home directory. My feeling is that cron does a better job here. If it's skipped a backup because the machine was switched off, no big deal. It'll catch up tonight. And it won't suddenly try backing up while you're creating spreadsheets just because it has a pang of guilt. -- el bid
Yup, it is
Anacron actually runs as a cron job; I set it to run every hour. So yeah, it's fairly likely that it will run while I'm using the computer, but since I "nice" the backup command I don't notice a slowdown, just some disk churning.
Yup, it is
but since I "nice" the backup command I don't notice a slowdown
I wasn't raising the issue of resource contention. The point I was making is that it's not a good idea in general to backup files the might be in use. You can't necessarily rely on the integrity of the backup. -- el bid
hfspax and anacron
boy, for those of us who are not unix wonks but aren't totally uncomfortable with typing in the command line and such, a simple step by step or pre-compiled script to backup folder a to location b that can be run with cronotab and retains all you'd expect (resource forks, invisible files, locked files, etc etc) would be so much appreciated....
hfspax and anacron
Almost exactly what you want is available from Mike Bombich's OS X Tips site. Check it out. It's listed in the links section here. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|