I'm having trouble getting a service to run on boot and shutdown. After boot, I query with
systemctl status scrThunderbirdProfileSync and get
systemctl status scrThunderbirdProfileSync ● scrThunderbirdProfileSync.service - Script to sync Thunderbird Profile to msc004 Loaded: loaded (/etc/systemd/system/scrThunderbirdProfileSync.service; enabled) Active: inactive (dead)
If I try
systemctl start scrThunderbirdProfileSync it works fine.
journalctl | grep scrThunderbirdProfileSync yields nothing except when I manually start the service.
Where am I going wrong? Is there any glaring errors? Should I be looking at two separate services, one for boot, one for shutdown? Note that I've chosen SystemD over my KDE's autostart etc as occasionally kde freezes when logging out and I have to manually shutdown the
I'm trying to sync Thunderbird data between two desktops (which are only on when I need to use them) and a mini-desktop (which is always on).
There are similar scripts on both desktops, they should trigger on boot to download latest data from the server and upload and newer files that haven't been uploaded, repeating when the desktop shuts down.
echo "1: Starting Sync > upload..." rsync -avzhu --progress /home/username/.thunderbird -e ssh root@server:/mnt/local/data/Personal/Thunderbird/ echo "2: Starting Sync > download..." rsync -avzhu --progress -e ssh root@server:/mnt/local/data/Personal/Thunderbird/.thunderbird /home/username/
[Unit] Description=Script to sync Thunderbird Profile to server DefaultDependencies=no Before=shutdown.target reboot.target halt.target kexec.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/scrThunderbirdProfileSync ExecStop=/usr/local/bin/scrThunderbirdProfileSync [Install] WantedBy=halt.target reboot.target shutdown.target kexec.target