[lug] Automated USB Drive Backup

karl horlen horlenkarl at yahoo.com
Thu Oct 25 22:59:19 MDT 2007


I've never used a USB external drive with linux
before.  

I'd like to create some rsync scripts to backup
directories to the external drive.  Manual scripts are
pretty straightforward. However, I'd like to be able
to automate the process so that the script fires when
the drive is plugged in.

I'm wondering if current distros are capable of
automounting and autoUNmounting these external drives
RELIABLY when plugged in and removed.

Is this functionality available in most stock installs
or do you usually have to post install rpms?  If rpms,
which one(s)?  FYI, I'm using CentOS but am curious
about how other distros handle this as well.

I imagine this is triggered by an fstab parameter?

On linux can you just unplug the drive or must you
"prep" it before doing so to prevent data loss? 
Normally on windows based systems you have to manually
"stop" the drive before you remove it, probably to
write out buffers or cache or something.

Does an automount "event" or some other method exist
that I could capture in a script to trigger the
backup?    I could setup up a cron job to poll and
check if the drive on the mount point was available
but I would need a way to prevent the backup job from
continuously re-firing on each iteration of the cron
job while the drive is plugged in.  It can be done but
I thought the ability to capture a single event would
simplify this.

Would succesfully implementing this have any bearing
on what type of filesystem I put on the drive?

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the LUG mailing list