Crontab and Shell executables

If you need to create crontab format easily, the best option is to use cronitor it will interactively help you to understand and create a working cron format

Editing crontab:

crontab cheatsheet

To edit:

  1. crontab -e
  2. Add this command line:
    30 2 * * * /your/command
    • Crontab Format:


    • Format Meanings and Allowed Value:
    • MIN Minute field 0 to 59
    • HOUR Hour field 0 to 23
    • DOM Day of Month 1-31
    • MON Month field 1-12
    • DOW Day Of Week 0-6
    • CMD Command Any command to be executed.
  3. Restart cron with latest data:
    From the cron man page:

    …cron will then examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified

    But if you just want to make sure its done anyway,

    sudo service cron reload


    /etc/init.d/cron reload


    service crond restart
If you need to better understand crontab check this link:

Making a sh or shell script exectuable:

You may want to run a script in crontab, so before adding it, you need to create one and making it exectuable.
Give execute permission to your script:

chmod +x /path/to/

And to run your script:


Since . refers to the current directory: if is in the current directory, you can simplify this to:


0 thoughts on “Crontab and Shell executables