Schedule a Weekly Reboot with Cron
To reboot a server once a week, add a reboot command to the root crontab at a low-traffic time. Use the absolute path to the reboot binary, and pick a window when a few minutes of downtime is acceptable.
The crontab line
Edit root's crontab with sudo crontab -e and add (3 AM every Sunday):
0 3 * * 0 /sbin/reboot
Or use shutdown with a reason logged: 0 3 * * 0 /sbin/shutdown -r now "weekly maintenance reboot".
Must be root
Only root can reboot. Put this in the root crontab, not a user crontab. The path is usually /sbin/reboot or /usr/sbin/reboot — confirm with which reboot.
Pick a safe window
Sunday 3 AM is a common low-traffic slot. Make sure services are set to start on boot (systemctl enable) so everything comes back up automatically.
Do you actually need it?
Scheduled reboots are a blunt fix. Prefer restarting the specific leaking service (systemctl restart) if only one process misbehaves — a full reboot is only worth it for kernel updates or broad instability.
FAQ
What cron line reboots the server weekly?
0 3 * * 0 /sbin/reboot in the root crontab reboots at 3 AM every Sunday. Use sudo crontab -e and the absolute path to reboot.
Why won't my reboot cron job work?
Reboot needs root — put it in root's crontab (sudo crontab -e), not a user crontab, and use the full path /sbin/reboot.
Should I reboot weekly or restart a service?
Prefer systemctl restart on the specific misbehaving service. A full weekly reboot is only worth it for kernel updates or broad instability.