You are not logged in.
Pages: 1
I am attempting to to create a weekly systemd service but have noticed on boot the service runs immediately. looking to avoid that the services runs each time i boot up
● rsync-home.service - rsync-home weekly backup
Loaded: loaded (/etc/systemd/system/rsync-home.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2017-12-05 12:20:24 CET; 25min ago
Main PID: 700 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/rsync-home.service
Dec 05 12:20:20 p50 systemd[1]: Starting rsync-home weekly backup...
Dec 05 12:20:20 p50 sudo[707]: ralpheeee : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/rsync -aAXv --delete --e
Dec 05 12:20:20 p50 home.sh[700]: sending incremental file list
Dec 05 12:20:20 p50 sudo[707]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 05 12:20:20 p50 home.sh[700]: ./
Dec 05 12:20:20 p50 home.sh[700]: .config/mutt/mailboxes
Dec 05 12:20:24 p50 home.sh[700]: sent 245,532 bytes received 1,933 bytes 54,992.22 bytes/sec
Dec 05 12:20:24 p50 home.sh[700]: total size is 4,294,841,397 speedup is 17,355.35
Dec 05 12:20:24 p50 sudo[707]: pam_unix(sudo:session): session closed for user root
Dec 05 12:20:24 p50 systemd[1]: Started rsync-home weekly backup.
[Unit]
Description=rsync-home weekly backup
StopWhenUnneeded=yes
[Service]
Type=oneshot
User=ralpheeee
ExecStart=/home/ralpheeee/.scripts/rsync/home.sh
[Install]
WantedBy=multi-user.target[Unit]
Description=rsync-home weekly backup
[Timer]
OnCalendar=Sun *-*-* 09:05:00
Persistent=True
Unit=rsync-home.service
[Install]
WantedBy=multi-user.targetLast edited by ralpheeee88 (2017-12-05 12:21:41)
Offline
Did you enable the timer or the service?
Offline
i enabled both the timer and the service
Did you enable the timer or the service?
Offline
OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=
Defines monotonic timers relative to different starting points: OnActiveSec= defines a timer relative to the moment the timer itself is activated. OnBootSec= defines a timer relative to when the machine was booted up. OnStartupSec= defines a timer relative to when systemd was first started. OnUnitActiveSec= defines a timer relative to when the unit the timer is activating was last activated. OnUnitInactiveSec= defines a timer relative to when the unit the timer is activating was last deactivated.
You want OnUnitActiveSec too.
Last edited by TheSpiritof69 (2017-12-05 12:23:57)
Offline
Pages: 1