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


Click here to return to the 'A script to prevent damage from rm -rf malware' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to prevent damage from rm -rf malware
Authored by: Han Solo on May 18, '04 01:51:40PM
OK, so shadowmirror will not work across Volumes. I am looking for a relatively transparent way to mirror my User directory to another Volume. (A networked Windows file server via SMB or AFP, if it matters.) I am already duplicating the drive locally every night to another drive in my MDD G4 with CCC, but that might not help much if my office gets flooded again. (Long story....)

Anyway, which of the above — rsync, rdiff-backup, and/or cpio — would satisfy those criteria? Any info would be helpful before I invest the time into figuring one of them out with my meager Unix knowledge.... TIA.

[ Reply to This | # ]

RE: Network backup question
Authored by: greebly on May 18, '04 02:21:48PM

I think that all 3 meet your criteria, but rsync and rdiff-backup are going to be easier to use and understand.

The bottom line is that each of those needs access to the Volume at the console level. If that can be accomplished, then you're fine.

However, you're going to need the target volume to support full UNIX permissions and ownership compatibility. SMB unfortunately doesn't do this properly, mostly because SMB/CIFS doesn't account for it in the protocol properly (UNIX permissions, not Windows ones). AFS should probably foot the bill. NFS certainly does.

---
--++-- Aaron Mildenstein --++--

Do not meddle in the affairs of Dragons,
for you are crunchy, and taste good with ketchup.



[ Reply to This | # ]
remote backup
Authored by: SOX on May 18, '04 02:22:15PM

rsync, rdiff, and cpio all have a problem with HFS+ and that is resource forks and metadata are destroyed. For 99% of your osx files this makes no difference but you will end up regretting it eventually. macosxlabs' RsyncX instead of the built in rsync takes care of HFS+, but is like rysnc plagued with silent malloc failures on deep directory trees that make it unsuited for unattended usage. If you actually check your error logs to notice those sorts of failures then RsyncX is probably the single best solution.

RsyncX is pretty close to your only choice if you cannot mount the remote volume on your local computer.

if you are able to mount the remote volume (as opposed to ssh-ing to the remote computer) and it's an hfs volume you could use Ditto or cpMac with the copy resource flag enabled.

If you are mirroring things that mostly dont change then the above two methods are inefficient. Instead use rysncX (with the caveat I noted.) Personally I use psync which is also more efficient and which does not have the deep path failure mode. It is slightly slower than rsyncX and wont work on things you cannot mounton the local machine.

Also for things you can mount you can use silverkeeper (free) from Lacie and (free) CarbonCopy Cloner (which uses a variety of methods under the hood including psync). Both of these are fast and work well. It's very easy to automate silverkeeper and maintain exclude lists using its GUI interface. I've had severe problems with silverkeeper but most people I know report complete success. But it does not fail silently.

psync has a nice feature of being able to stash your metadata and protection factors when you are stroring on a remote volume that is not HFS aware. They can be restored later.

with psync its:
mount remote disk
pysync the local to the remote directory


then as an added bonus on the remote machine I normally execute
find /mybackup | cpio -dpl /backup.1
before I run psync. this gives me a snapshot of the previous generation backup that takes almost no added disk space. you can keep as many of these as you want for weekly, monthly backups....the only storage space it uses is to store the differences.




[ Reply to This | # ]
remote backup
Authored by: SOX on May 18, '04 02:24:42PM

note that while cpio has problems with meta data, oddly enough this is not a problem for the prescribed usage of making hard links. this only affects the primary copy. that is dont use CPIO to make a backup copy. use it to make a hardlink image. make the bakcup copy with something else.



[ Reply to This | # ]
remote backup
Authored by: greebly on May 18, '04 02:35:28PM

Hmmm. Perhaps I will have the backup performed to my other Mac with an HFS+ volume, and make .dmg's of that volume from time to time.

I don't think it's going to be a HUGE problem though. Most of the important data is backed up, and those are documents, etc. which, as you say, are part of that 99% of files that won't be affected.

---
--++-- Aaron Mildenstein --++--

Do not meddle in the affairs of Dragons,
for you are crunchy, and taste good with ketchup.



[ Reply to This | # ]
remote backup
Authored by: SOX on May 18, '04 06:59:36PM

still will lose the creator code if the suffix is missing.



[ Reply to This | # ]
remote backup
Authored by: greebly on May 18, '04 02:57:56PM
According to this post, the metadata problem has been solved in recent versions of rdiff-backup.

That's been my experience so far as well. I haven't had a problem with my backups, having checked the logs.

---
--++-- Aaron Mildenstein --++--

Do not meddle in the affairs of Dragons,
for you are crunchy, and taste good with ketchup.

[ Reply to This | # ]

RE: Network backup question
Authored by: greebly on May 18, '04 02:27:15PM

2nd note: Let me reiterate again, trying to store UNIX files on a windows file server is a disaster waiting to happen if you are trying to make a completely recoverable file. The best way to do this would be to make a tar backup (or a dmg image or something like it) and save that file on the windows server. Permissions and such will be lost in a file copy style backup (like rsync, rdiff, etc.) and if you're only wanting to backup document files and such, that's not going to be a problem. A full restore, however, would be messed up beyond belief.

---
--++-- Aaron Mildenstein --++--

Do not meddle in the affairs of Dragons,
for you are crunchy, and taste good with ketchup.



[ Reply to This | # ]
RE: Network backup question
Authored by: SOX on May 18, '04 07:02:02PM

the native Tar and zip are not hfs aware either. however, you can use the new apple zip-archive feature and transport that. (dont expand it on the remote file system or you may lose the meta data)



[ Reply to This | # ]