Schedule a task on Linux – crontab


As a release engineer, you have to schedule a task sometimes. On Windows, you might use Task Scheduler to schedule one.

On Linux platform, it also provides a very elegant tool to schedule tasks. It is crontab.


Crontab could empower you to schedule tasks in ‘Minute’ ‘Hour’ ‘Day of Month’ ‘Month’ and ‘Day of week’.

Check below line:

30 * * * * cd /u01/abc ; ./ parameter=y >> /u01/log/output.log

It means, Linux will run cd to /u01/abc and run script ./ parameter=y and its output will be appended to  /u01/log/output.log in every 30mins.

And then, you can create a file (supposed its name is cron.txt) and in the text it could contain your lines as below,

30 * * * * cd /u01/abc ; ./ parameter=y >> /u01/log/output.log

* * * * * cd /u01/def ; ./ parameter=n >> /u01/log/deflog.log

and then issue command:

crontab cron.txt

Done. 🙂

Pls. note, ASA your OS get reboot, you should rerun your crontab.

You can issue command to check your crontab items.

crontab -l

Details, pls check out