[CentOS] Re: Backups on external USB HDD

Tue Nov 20 18:18:01 UTC 2007
Ugo Bellavance <ugob at lubik.ca>

David Ferreira wrote:
> Hi
> 
> If Device 009 is your USB HD, then, your /etc/hotplug/usb/usbhd.usermap 
> sould look like that:
> 
> #usb module   match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi 
> bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass 
> bInterfaceSubClass bInterfaceProtocol driver_info
> usbbackup    0x0003    0x04fc    0x0c25    0x0000    0x0000    0x00    
> 0x00    0x00    0x00    0x00    0x00    0x00000000
> 
> 
> Well, now the script. only one question, Do you use backup exec to write 
> on linuxbox fs and then, rsync to the usb hd?, or do you want to backup 
> exec directly backup to the usb hd? If you do a rsync from local linux 
> fs to the USB disk, you can umount the fs in the script when it's 
> finish. If you choose the second option (Backup diretly to the usb hd) 
> you sould find other way to umount the usb drive once you have finished 
> backup (I think the easiest  way is a cron job). I think first option is 
> beter, so you can use this pseudo-script in /etc/hotplug/usb/usbhd:
> 
> #!bin/bash
> mount -t auto /dev/sd0 /mnt/backup
> rsync -Pavz --delete /tmp/backup /mnt/backup
> umount /mnt/backup
> 
> If you prefere second option, you must made accesible /mnt/backup as you 
> prefer to your windows box, quit rsync and umount from script, and 
> create a cron job to umount the usb drive.
> I think now is enough clear what do you have to do.

Yes, I'd rather use the 2nd option, as the USB HDDs' size is 250 GB, 
while I only have about 100 GB locally.

Therefore, I only need the first line, so that it is automatically 
mounted?  In fact, what I want is to always have /dev/sda1 mounted as 
/mnt/usbbackup (example) as soon as it is connected.

My backup usually takes about 5 hours, so if I start it at 19.00, it 
will be safe to umount the volume anytime after 4AM, for example, using 
a cronjob.

Does this make sense?

Is there a way to test it w/o being on site (one HDD is already connected).

Regards,
Ugo