[CentOS] Re: Backups on external USB HDD

Tue Nov 20 17:58:22 UTC 2007
David Ferreira <dferreira at izanet.com>

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.

Greetings,
David


Ugo Bellavance escribió:
> David Ferreira wrote:
>> I've used simple  scripts for similar backup system. I used hotplug 
>> facilities and rsync to avoid copying inecesary data.
>> You must see the USB id which lsusb
>>
>> in /etc/hotplug/usb/ create the folowing two files:
>> usbhd.usermap containing the folowing line:
>> usbbackup 0x0003 0x05e3 0x0702 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 
>> 0x00 0x00000000
>
> I don't need the script, I just need the windows box to be able to 
> write  to the external HDD, and that the external HDD can be changed 
> (not when writing, of course) without any manual intervention.
>
> This is the output of lsusb
>
> [root at server]lsusb
> Unknown line at line 5959
> Unknown line at line 5960
> Unknown line at line 5961
> Unknown line at line 5962
> Unknown line at line 5963
> Unknown line at line 5964
> Unknown line at line 5965
> Unknown line at line 5966
> Unknown line at line 5967
> Unknown line at line 5968
> Unknown line at line 5969
> Unknown line at line 5970
> Bus 004 Device 001: ID 0000:0000
> Bus 003 Device 001: ID 0000:0000
> Bus 002 Device 001: ID 0000:0000
> Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd
> Bus 001 Device 001: ID 0000:0000
>
> The device is most likely 001/009 (Sunplus).
>
> lsusb -v shows this (stripped output):
>
> Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x04fc Sunplus Technology Co., Ltd
>   idProduct          0x0c25
>   bcdDevice            1.03
>   iManufacturer           2 Sunplus Technology Inc.
>   iProduct                3 USB to Serial-ATA bridge
>   iSerial                 1 WDC WD2500     WD-WXE807734118
>   bNumConfigurations      1
>
> How would I build my usbhd.usermap file?
>
> Regards,
> Ugo
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

-- 
David Ferreira
Dpto. de sistemas
-------------------------------------------------------------------------------------------------
I Z A N E T - GLOBAL SERVICES S.L.
 
web: _http://www.izanet.com_ <3D%22http://www.izanet.com/%22>
Direcciónes: Argualas nº 3 (Planta calle) - 50.012 Zaragoza
Teléfono: 902 999 065 y 976 306 752 - Fax 976 306 753
-------------------------------------------------------------------------------------------------- 


*DISCLAIMER:
*Este mensaje se dirige exclusivamente a su destinatario y puede 
contener informacion privilegiada o confidencial. Si no es vd. el 
destinatario indicado, queda notificado de que la utilizacion, 
divulgacion y/o copia sin autorizacion esta prohibida en virtud de la 
legislacion vigente. Si ha recibido este mensaje por error, le rogamos 
que nos lo comunique inmediatamente por esta misma via y proceda a su 
destruccion.

This message is intended exclusively for its addressee and may contain 
information that is CONFIDENTIAL and protected by professional 
privilege. If you are not the intended recipient you are hereby notified 
that any dissemination, copy or disclosure of this communication is 
strictly prohibited by law. If this message has been received in error, 
please immediately notify us via e-mail and delete it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20071120/7bf2e743/attachment-0005.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dferreira.vcf
Type: text/x-vcard
Size: 289 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20071120/7bf2e743/attachment-0005.vcf>