There are four basic commands that can be used when working with crontab:
crontab -e-Edits a crontab for the current user. The crontab file is generated when you were exiting your editor.
crontab -l-Lists contents of crontab file for current user.
crontab -r-Removes crontab for current user.
crontab -u userid-You can specify a specify user by using the “-u” flag.
But when you type the command
crontab -l and the result returns No crontab for root.
Your crontab not run. You need to run your command on the root with 4 steps:
- Step 1:
- Step 2:
o(o in alphabet)
- Step 3: Fill your command. Ex:
*/2 * * * * root /usr/local/auto/restart.sh >/dev/null 2>&1
- Step 4: Exit
- Review your CMD –>
crontab -l. It was saved here(/var/spool/cron)