Apps :: Syncing folder from USB Stick



What I'm trying to accomplish is the following.

Assoon as I insert an USB Stick, I want DSL to automaitcly copy all the files from the stick to a folder on hda3.

Anybody got any Ideals how to do this, I figure through a script of some sort.

Thx :)

Quote (Zorak_asread @ Feb. 09 2007,04:57)
What I'm trying to accomplish is the following.

Assoon as I insert an USB Stick, I want DSL to automaitcly copy all the files from the stick to a folder on hda3.

Anybody got any Ideals how to do this, I figure through a script of some sort.

Thx :)

I can think of several ways of doing it, but I'm left with more questions why I'd want to do that. Are you doing this via the CD, frugal, or hard drive install?

Are you going to be using multiple sticks? If just one stick, why not just mount in emelfm and copy everything by highlighting the whole stick? Are you willing to give up your use of all USB media strictly for this use? Or would you need a way to stop and start the automatic sudo mounting and copying * to hda3? Do you want it to overwrite things in the same directory on hda3 or go to new directories each time?

Personally, I don't think it's a good idea to automatically do something like that when it's easy enough to use something like emelfm as root, highlight, and copy; or even just use your bash history (up-arrow key) to mount/umount and cp. It's not going to save you that much time unless you're copying loads of sticks on a frequent basis. And it would render USB pretty much useless for other media unless you had a stop/start to the script.

I'm creating a pictureframe PC. DSL installation with a folder in which I place my images. This machine isn't connected to any network, so what I want to do is just plug in my USB stick, and have this action result in the execution of a script that will copy over the new files from the stick to the harddisk, and then restart my image viewer so the new images are included in its filelist.

My problem is that I don't know how to get a script to run in response to the insertion of the USB stick. Suggestions?

I have the script on my site that another user posted (yes I forget to give him/her credit) http://www.frontiernet.net/~pictureframe

As I understand it the only "automatic" way is to boot with the drive inserted and let bootlocal.sh kickoff the script, since there's no easy to continuously poll for a usb drive and mount it/run a script.

I'd say the most useful method (or at least one of) would be to set up a hotkey.  Instead of a script constantly running, checking to see if a stick has been inserted (and whether this stick is not the same as the one that was previously inserted), you could simply plug in the stick and then press a key or combination of keys to launch the script. This also removes the need to have your stick plugged in at boot time, and can be done at any time.

Automating can get a bit overused at times....sometimes it's better to save the development time and effort, as well as cpu load, and trade it for minor physical activity.

Next Page...
original here.