usb key rsync script

Henk Postma henkpm at
Sun Mar 13 21:27:33 UTC 2005

Dear Paul, 

I've been looking for sth like this for some time, but haven't had the
patience to fully research it. The easiest way seems to be to enable
'autorun' on removable storage in the gnome settings, and have the
rsync script started by the autorun script on you usb drive. This way
you let gnome do all the heavy lifting on DBUS, HAL.

Please note that autorun is also a security risk, if you insert
untrusted media with an autorun script on it, all hell breaks loose.
Use with caution.

Come to think of it, I'm not sure if autorun also works for usb
drives, or only for cdroms ...

Nice gnome dialogs (popups, error windows etc) can be started from
scripts with 'zenity'

Let me know if you get it working, I would like to set up sth similar. 

- Henk

On Sat, 12 Mar 2005 22:14:27 -0500, Paul Pianta <ppianta at> wrote:
> Hi people
> I would like to do something really cool but am not too sure where to
> get started on it.
> I want to create a bash script that will run a single rsync command that
> will sync a certain directory on my hard-drive onto my usb key.
> The tricky part is that I want this to run automatically when my usb key
> is plugged in. ie.
> 1. Plug in usb-key
> 2. rsync script is run automatically
> 3. a dialog pops up saying - rsync success/failure (and maybe some
> parsed --stats from the rsync command)
> 4. clicking ok on dialog unmounts the usb key
> So as you might have guessed - the usb key is merely a media for backing
> up my chosen directory. Anyone have any ideas where to start with this?


More information about the ubuntu-users mailing list