How to FIX No crontab for root

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.

No crontab for root

Your crontab not run. You need to run your command on the root with 4 steps:

  1. Step 1: crontab -e
  2. Step 2: o (o in alphabet)
  3. Step 3: Fill your command. Ex: */2 * * * * root /usr/local/auto/restart.sh >/dev/null 2>&1
  4. Step 4: Exit
    • ESC
    • :wq
    • Enter
  5. Review your CMD –> crontab -l . It was saved here(/var/spool/cron)
Fix No crontab for root

It’s done.

No crontab for root: Done



How to make FAQ

Admin

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.