Finally got together and uploaded my second rsync script I mentioned earlier in this posting. Instead of mirroring one internal drive (all partitions) to another, this will copy contents of one path to the external drive, optionally delete old files on removable disk from the previous rsync and finally eject/spin-down the drive if wanted.
Dec
16
I’ve been using my rsync mirror script for a few weeks now and have implemented an additional one or two tweaks after deploying it on my desktop system as well.
- Firstly, now you can you use the same script across multiple boxes – the UUIDs are configurable per hostname
- A bug was fixed where the script would fail if the destination disks were not already mounted.
- You can also customize the rsync invocation on a host-basis as well. This was needed on my desktop machine where a /home account was mounted via NFS on a different file system causing IO errors and subsequently skipping the file deletion.
One final enhancement I want to add is the ability to spin the backup disk down after rsync is complete – this will not only help to increase drive life but also help reduce power use (however small it may be). For some odd reason on my machines whenever I stop (umount, sync, then spin-down) an internal disk it works for a few seconds, then the drive spins back up again and I’m seeing ATA link reset messages as if it was just being plugged in. External drives connected with eSATA seem to work just fine however. Need to look into that more.
Also shortly available:
- A similar but different script I use for syncing my RAID storage array with an backup external drive connected via eSATA. It’s a bit of a hack in some spots, but the nice thing is that it is almost fully automated. Use this on a machine with one of those eSATA docks and you have a good way of making a quick backup of an array or disk.
- Sample service account script implementation with the ‘chattr’ command.