I am trying to do a backup of home directory from local SSD to local HDD on a desktop PC ruing Ubuntu 15.10. The idea is to perform a synchronization using rsyncrypto during the poweroff equence, because there are no file operations in home directory at that time, and I don't really care if the sync takes some time. So I created this systemd unit:
Code:
[Unit] Description=backup to inteal HDD before shutdown Before=umount.target poweroff.target After=plymouth-poweroff.service DefaultDependencies=no [Service] Type=oneshot User=root ExecStartPre=/bin/plymouth message "--text=Backuping SSD to HDD..." ExecStart=/bin/bash /home/user/rsyncrypto.backup ExecStop=/bin/plymouth message "--text=Finished backuping SSD to HDD" KillMode=none [Install] WantedBy=poweroff.target
From what I understand, this should not happen. Unmounting of all local drives is triggered by umount.target which should be started after my service. The service type is 'oneshot', so all subsequent units should wait until it finishes.
What am I missing?
برچسب:
نویسنده: استخدام کار