Create systemd timer

Replacement for cron with Persistent=true for missed runs

cat > /etc/systemd/system/backup.timer <<EOF [Unit] Description=Daily backup [Timer] OnCalendar=daily Persistent=true [Install] WantedBy=timers.target EOF

tool
systemd26 commands
tags
systemd

More systemd commands

  • systemctl set-property myapp.service MemoryMax=512M CPUQuota=50%

    Apply cgroup limits without editing unit file

  • systemctl status myapp.service | grep -E 'Memory:|CPU:|Tasks:'

    Current memory, CPU, and task counts from cgroup

  • systemctl list-units --type=socket --all

    All socket-activated units and their state

  • systemctl mask snapd.service

    Prevent a service from being started by anything

  • systemctl show myapp.service -p Environment

    Print environment variables injected into the service

all 26 systemd commands