Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I got a CentOS 5.3 fileserver machine (no monitor/kb/mouse).
I'd like to "pair" it with a specific USB drive, so that when this USB drive is connected and mounted it would start a backup - just a simple cp /source /target will do for now - it's the "autorun on mounted a specific USB drive" part I can't really solve.
Is there an elegant way to do this some sort of autorun? My only really rough idea to do it is to check if the USB drive is available with a script run in crontab every minute :-\
may be it is time to forget usb storage and use a cloud storage service, such as Dropbox.
The cloud... Well, in this case I want to backup photos (about 15GB so far, and rapidly growing), and I honestly don't trust the cloud as a source of backup. I'd rather go the "backup buddy"-way, than the cloud in this case to be honest.
Last edited by mr_minning; 10-14-2010 at 01:35 AM.
Yeah - good read; slightly dated, I'm afraid. udevinfo isn't
around any more. But a google for udevadm & serial should get
you on the right track. If I still had the command in roots
bash_history I would have posted it - but I don't ;}
I have some trouble getting this to work. My target machine has CentOS 5.4, but it doesn't have the udevadm command. So I tried to do the developing on a Fedora 13 laptop.
I thought that it would be nice not to change any mountpoints or such. Gnome always mounts the USB disk as /media/BackupDisk anyway. So I created a /etc/udev/rules.d/98-local.rules (I've tried to name it 10-local.rules too) that looks like this:
KERNEL=="sd?1", SUBSYSTEMS=="scsi", ATTRS{"serial"}=="00E0010575A18", RUN+="/etc/udev/backup"
I've tried some variants of above too (like)
DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{"serial"}=="00E0010575A18", RUN+="/etc/udev/backup"
After each change I ran:
udevadm control --reload-rules
The unplugged the usb cord, waited a few sec, and then replugged it.
The file /etc/udev/backup (permission 755) has been reduced to a bare minimum to se if it runs (which it doesn't):
#!/bin/bash
touch /tmp/zzzz
Still nothing How do I go about debuging this? Or is there an obvious blooper above?
I found my mistake. It's supposed to be ATTRS{serial} w/o quotationmarks. I also removed the KERNEL bit and changed SUBSYSTEMS to "usb". Just to keep it in the same hierarchy level. Dunno if it makes a difference, but it works now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.