Setting up a cron job in
Linux command line

Cron is used to schedule tasks to run at specific intervals (minutes, hours, days, months…).
Use SSH to access your server’s command line.

Type:

This will show all configured cron jobs on the server.
To add a new cron job or to edit an existing one type:

Edit / add as needed. The format for scheduling is (see examples below):

When finished press – “Esc”, “:”, “wq” (w-rite q-uit).
Done!

Cron examples:

Execute every minute –

Execute twice daily at 4:00 and 20:00 –

Run on Saturdays at 6:00 –

Run every 4 hours –

 

 

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *