Hi,
I'm trying to start a Backup when I'm plugging in a USB Drive.
It works partially.
I'm starting the backupscript from the udev-rule.
But in the script when it start rsync.... after a few minutes it hangs and stopps working.
When I start the script by hand it works without any errors.
When I start the script from contab (e.g. /etc/cron.hourly) it works too.
what can be the reason?
greetings
-zoran-
starting rsync from udev
Re: starting rsync from udev
When you start a program from a udev rule, that program is supposed to complete within a short time, because udev waits for the completion of the program. Udev does not want to wait forever, since that would mean that it cannot handle other device events.
You should create a script that is called on insertion of your USB drive and that starts the rsync task as a (detached) background process, so the script can return promptly. See http://www.reactivated.net/writing_udev ... ternal-run
You should create a script that is called on insertion of your USB drive and that starts the rsync task as a (detached) background process, so the script can return promptly. See http://www.reactivated.net/writing_udev ... ternal-run