/etc/systemd/system/zypper-preload-upgrades.service
[Unit]
Description=preload upgrades
After=multi-user.target
[Service]
Type=oneshot
ExecStartPre=/usr/bin/zypper --gpg-auto-import-keys ref
ExecStart=/usr/bin/zypper dup -d --force-resolution --no-confirm --auto-agree-with-licenses
#Restart=always
#RestartSec=120
[Install]
WantedBy=multi-user.target
/etc/systemd/system/zypper-preload-upgrades.timer
[Unit]
Description=preload upgrades timer
[Timer]
OnCalendar=weekly
#OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target
#!/usr/bin/env sh
#echo -e "OnCalendar=\nOnCalendar=$@" > /etc/systemd/system/zypper-preload-upgrades.timer.d/override.conf && systemctl daemon-reload
echo "OnCalendar=" > /etc/systemd/system/zypper-preload-upgrades.timer.d/override.conf
echo -e "OnCalendar=$@" >> /etc/systemd/system/zypper-preload-upgrades.timer.d/override.conf
systemctl daemon-reload