# /etc/systemd/system/cleanup.service
[Unit]
Description=Clean temporary files
[Service]
Type=oneshot
ExecStart=/usr/local/bin/cleanup.sh
# /etc/systemd/system/cleanup.timer
[Unit]
Description=Run cleanup daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
sudo systemctl daemon-reload
sudo systemctl enable --now cleanup.timer
systemctl list-timers
journalctl -u cleanup.service
Persistent=true runs a missed job after the machine was off. Timers give you logs, dependencies and resource limits that plain cron lacks; cron is shorter for simple jobs.