That would seem to repeatedly call rsync as long as the folder is there. Probably not what you wanted.<br>Anyone have a better way? :)<br><br><div class="gmail_quote">On Sat, Apr 12, 2008 at 10:57 AM, Jackson Cooper <<a href="mailto:mail@jacksonc.com">mail@jacksonc.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sebastian,<br>
<br>
The way I'd do it is create a daemon with an infinite loop (I don't<br>
know much about udev though) that looks for the folder<br>
/media/nameofusbdongle, and if it exists execute the rsync line, then<br>
an umount line. Something like...<br>
<br>
<CODE><br>
while true; do<br>
if [[ -d /media/nameofdongle ]]; then<br>
rsync -switches /media/nameofdongle /some/other/path<br>
umount -switches /media/nameofdongle<br>
else<br>
sleep 1<br>
fi<br>
done<br>
</CODE><br>
<br>
Then to make it a daemon, you could use the start-stop-daemon program.<br>
Type "man start-stop-daemon" in the terminal to find out more.<br>
<font color="#888888"><br>
- Jackson<br>
</font><div><div></div><div class="Wj3C7c"><br>
<br>
On Fri, Apr 11, 2008 at 7:55 PM, Sebastian Spiess<br>
<<a href="mailto:sebastian.spiess@gmail.com">sebastian.spiess@gmail.com</a>> wrote:<br>
> hi all,<br>
> I want to sync some of my USB dongle folders when I plug it in. I think I worked that out: create a rule<br>
> /etc/udev/rules.d/85-usbstick.rules and call the script to sync.<br>
><br>
> But how about when I want to unplug the thing? Then there is no usb/hotplug event. Would the simplest thing be a script<br>
> with unmount/eject at the end?<br>
> How could I call this script through the icon (unmount menu) on the desktop?<br>
> How to make the eject/unmount wait until rsync is done?<br>
><br>
> by the way what's the difference between unmount and eject?<br>
><br>
> thanks Sebastian<br>
><br>
> --<br>
> ubuntu-au mailing list<br>
> <a href="mailto:ubuntu-au@lists.ubuntu.com">ubuntu-au@lists.ubuntu.com</a><br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-au" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-au</a><br>
><br>
<br>
--<br>
ubuntu-au mailing list<br>
<a href="mailto:ubuntu-au@lists.ubuntu.com">ubuntu-au@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-au" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-au</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.kiva.org/lender/frode">http://www.kiva.org/lender/frode</a><br><br>