← Volver al blog

How to Set Up Cron Jobs in Linux

  • Xernode
  • 1 min de lectura
  • 7 de abril de 2026
Backups cron linux vps automation schedule

Introduction

Cron jobs allow you to automate tasks on your Linux VPS by scheduling scripts or commands to run at specific times. This guide shows you how to set up and manage cron jobs.

Step-by-step Guide

  1. Open the crontab editor for your user
    • crontab -e
  2. Add a new cron job (example: run a script every day at 2 AM)
    • 0 2 * * * /path/to/your/script.sh
  3. Save and exit the editor (usually Ctrl+OEnter, then Ctrl+X for nano).
  4. List your current cron jobs
    • crontab -l
  5. (Optional) Remove all your cron jobs
    • crontab -r

Recommendations

  • Use absolute paths in your cron jobs.
  • Redirect output to log files for troubleshooting.
  • Use crontab -u username -e to edit another user's cron jobs (as root).

Call To Action

Want reliable automation on your VPS? Check out our hosting plans: https://xernode.com/#pricing

Related Guides