usb auto mount when nobody is logged in?

Tom Horsley horsley1953 at gmail.com
Tue Nov 30 18:42:39 UTC 2010


On Tue, 30 Nov 2010 10:32:47 -0800
Alan Evans wrote:

> I just want to back up some files in a cron
> job but only if there's a drive plugged in

If the cron job is running as root, you should be able
to just do something like:

if mount LABEL=BACKUP /backup
then
   ...do backup stuff...
   umount /backup
fi

or you could use UUID=gibberish syntax, etc (whatever
seems convenient to properly identify the partition
on the usb drive).


More information about the users mailing list