LINUX.ORG.RU

История изменений

Исправление Siado, (текущая версия) :

надо кастовать intelfx

А в своем скрипте замени cp на rsync

З.ы. а вообще есть решение без скриптов в udev:

There's much nicer solution with systemd now. You create a service which depends and is wanted by you media e.g.: /etc/systemd/system/your.service

[Unit]
Description=My flashdrive script trigger
Requires=media-YourMediaLabel.mount
After=media-YourMediaLabel.mount

[Service]
ExecStart=/home/you/bin/triggerScript.sh

[Install]
WantedBy=media-YourMediaLabel.mount
Then you have to start/enable the service:
sudo systemctl start your.service
sudo systemctl enable your.service

After mount systemd fires your trigger script. The advantage over udev rule is that the script really fires after mount, not after adding system device.

Use case: I have a crypted partition which I want to backup automatically. After adding the device I have to type-in password. If I hooked the backup script to udev, the script attempts to run at the time when I'm typing password, which will fail.

Resource: Scripting with udev

Note: You can find your device unit with: sudo systemctl list-units -t mount

https://askubuntu.com/questions/25071/how-to-run-a-script-when-a-specific-fla...

Исходная версия Siado, :

надо кастовать intelfx

А в своем скрипте замени cp на rsync