[kwlug-disc] Backups and Hard Disks
paul_nijjar at yahoo.ca
Wed Aug 19 10:41:19 EDT 2009
On Tue, Aug 18, 2009 at 09:05:20PM -0400, Chris Irwin wrote:
> I'm recovering from a hard disk failure in my laptop. Luckily I didn't
> lose anything due to my constant use of `unison` to my server, but it
> got me thinking: This is not nearly as automatic as I would like as it
> relies on me to manually run unison.
> Has anybody come up with a better solution? Mainly I'm talking about a
> laptop that works disconnected fairly often, so you can't assume it
> will be on 24/7 for a scheduled job at night.
First of all, congratulations on being diligent with your backups.
anacron is your friend. If you can guarantee that the laptop is going
to be able to access your backup share when it is on, then you are
done. Just run a cronjob as frequently as you want backups and anacron
will make sure they happen.
If you cannot make such a guarantee, you can have a script that first
checks to see two things:
- Has it been long enough since the script last did a successful
- Can it access the backup share?
If those are both true then you run the backup and update the "last
successful backup" token.
I have not actually implemented this solution, but I do use cron to
schedule backups via rsync all the time.
More information about the kwlug-disc