13 Jun
2021
13 Jun
'21
6:19 p.m.
On Sat, 12 Jun 2021 at 13:59, Maykel Franco via arch-general <arch-general@lists.archlinux.org> wrote:
Hi, I try configure the rule in udev for when I connect specific usb device, launch script backup.
I have this rule:
/etc/udev/rules.d/10.autobackup.rules
SUBSYSTEM=="block", ACTION=="add", ATTRS{idVendor}=="058f", ATTRS{idProduct}=="6387", SYMLINK+="external%n", RUN+="/usr/local/bin/autobackup.sh"
you'd be better of if you use an oneshot systemd service for this. See https://www.freedesktop.org/software/systemd/man/systemd.device.html#SYSTEMD... RUN in udev rules is not meant for any long-running processes, actually only very short running processes https://www.freedesktop.org/software/systemd/man/udev.html#RUN%7Btype%7D -- damjan