I've got a tmpfs mounted to /var/something/else and I'd like to copy files to the location immediately after it's mounted. So if I run (or action executed after server reboot):
mount /var/something/else
- mounted
- files synced from hdd to tmpfs
- a daemon started
and it would be great if I run
umount /var/something/else
- daemon stopped
- files synced from tmpfs to hdd
- unmounted
Yes, it's possible to modify init/systemd script of the daemon to do all the required (mount/umount/sync). But is there another option?
The rules in /etc/udev/rules.d/ does not seem to work here...if I get it right.
Regards, Alex.