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.
Tags: coding, howto, linux, rsync, scripts, sysadmin, update
I was google’n md0_raid5 looking for ways to stop my raid arry being accessed and thus the drives to spin down… I got pointed here but can’t seem to find the related information… can you please point me in the right direction!
Regards,
Allan
Hello Allan,
I actually have tried something similar myself without much success so far. It’s not difficult to get a drive to manually spin down, but I’m not 100% sure it can be done on software raid array that is mounted (even if it’s not being accessed). I would check the hdparm and sdparm commands, you can force a drive to go to sleep or spindown with that application. You can also use /sys/class/scsi_device/… to accomplish the same thing if you are using SCSI or SATA drives on a recent kernel. Read a bit more about it here : https://wiki.kubuntu.org/WarmplugFailedRaidDisk