Automate backup when a particular thumb drive is plugged in
Hi
I am mobile a lot (mobile == I use a number of different computers at different places) . I also use my pen drive to store/update my files/document as I find its much easier on me (I don't live in a country where net access is easy / painless). What I want to achieve is : * As soon as I plug in my pen drive to my home computer running slackware (the particular drive could be recognized by its uuid) , a particular folder is automatically copied by Slackware to my ~. Any ideas on how I could do this ? I think HAL/udev should be able to recognize the drive, and then I need to somehow call a script. Any cool scripts/help would be great. thanks duryodhan |
Yep, udev can run a script based on criteria you specify. See: http://www.reactivated.net/writing_u...l#external-run
|
ok .. am not at my Slack machine right now so can't test this but quick question
wouldn't this run before HAL has mounted the USB Key... and if I haven't mounted the key how can I copy something from it ? |
You could probably fork and return and then wait for some time and try the copy, as a thought.
|
You could try ivman/pmount to perform commands upon plugging in the thumb drive. I have no experience with either, but I *think* it should work. pmount just allows normal users to mount via HAL (ie a console version of the WM/DE-specific events), while ivman allows you to run commands when something is plugged in. I'm not sure if you can get away with JUST using ivman or if you need pmount as well -- not having any experience is not helping me here. However, a little research should help you figure that out. rworkman *seems* to know a bit about this based on past posts, but he may never see this. You might be able to search the forums for ivman for more help.
Good luck. |
Thanks for your help all.
Quote:
T3Slider - awesome .. it worked ! I am just posting what I did here ... someone else on searching can use it (as well as you guys can comment) to start at console - Quote:
and plug in your usb key. you might get something like below Quote:
Now go to slackbuilds.org and get the builds for ivman and pmount and install both. Now Quote:
Quote:
Also note how we matched the uuid noted down earlier . I also automatically umount after the backup is done .. I am just more comfortable with some setup like this. Now just add ivman to your startup .. for fluxbox (like me) , I added to the ~/.fluxbox/startup file. I didn't add it to rc.local cos I don't think above will work well if I run ivman as root. |
Much nicer solution, I must say. I'd never heard of ivman until this.
|
Quote:
|
All times are GMT -5. The time now is 06:50 PM. |