I have two sata backup drives which I use for daily rsync backups. As the drive is running for a relatively short time during the night I don't want it rotating for the rest of the time.
hdparm -S 12 /dev/sdb will set the spindown to 1 minute after the last use and that works from the command line. However I would like the command to be automatically given when the drive is inserted and reading on the Internet suggests using UDEV.
I've put this in a .rules file:
# Set spindown time for backup drive when inserted. KERNEL=="sdb", RUN+="/sbin/hdparm -S 12 /dev/sdb"
But that doesn't work i.e. nothing happens. When I first tried I put only one = after KERNEL and UDEV complained so I know it is being 'seen' and the drive is always 'sdb'.
Should it work?