I’ve been mucking about trying to come up with something lightweight to back up my neighbour’s computers to their NAS device. The unit comes with some software, but it doesn’t handle multiple users well, and the Mac version broke itself.
Yes, there’s a Mac involved. I wasn’t keen. I’ve never really ‘got’ Macs, and I get frustrated with them hiding some of the complexities. This is, of course, just what their fans love. Anyway, back to that in a minute.
The XP & Vista PCs are easy: a quck robocopy script along the lines of:
robocopy "%userprofile%" \\NAS\%username% /E /XJ /r:0
Does the job nicely. It will even skip unchanged files, even if it’s a bit lazy in that it just dumps the whole user profile.
On to the Mac. I borrowed an old G4 Macbook, and got frustrated with the single mouse button, but after a while the interface begins to make sense, ish.
I thought about Time Machine, the Apple-supplied utility- even finding a version that would talk to a CIFS network share. It does what it says, to be fair, but my old frustrations return- it is intended to fill up a disk with backups, then manage those backups by deleting the oldest and filling up again. This isn’t good for a shared filespace, and it’s not configurable. That’s good for a user who doesn’t care and has a drive for backups alone though- in that case it will ‘just work’.
The answer once again is the salvation of the shell prompt: OSX is after all FreeBSD with an Apple layer on the top. A bit of googling reveals you can mount a CIFS share from a command line (even if it doesn’t appear in the GUI), and unmount it afterwards.
OSX also follows the Unix-like idea of user files in a home directory, so dumping that directory does a reasonable job of a backup:
mount_smbfs //username:password@NAS/macbackup /Volumes/backup
cp -R ~/* /Volumes/backup
umount /Volumes/backup
and if you name the file backup.command (well, anything.command), it can be launched from the Finder, and it then runs in a terminal. You have to pre-create the mount point beforehand.
Result! This isn’t quite as slick as Robocopy as there’s no checking if the file exists, but hey ho.