

Therefore, we tweaked the settings in the crontab file as: 0 * * * * script.sh > /var/log/script.log On checking, our Support Engineers found that he had set up script in a way to redirect output to a file. He had set up a backup script to back up data on his server using an hourly cron. Recently, one of our customers had a problem with crontab not sending emails. Usually, Cron will send the STDOUT and STDERR from the script to email. Now let’s see the major reasons for cron job-related errors and how our Support Engineers fix the top errors.ġ. In cPanel, we can add the MAILTO variable as follows.Īt Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while receiving cron job mails. To add the MAILTO variable, we add ‘ ’ into the crontab file. It can even send details to the user named in the MAILTO environment variable in the crontab. Moreover, in order to notify the user whether the command is running successfully, cronjob has a feature that mails the output to the owner of the crontab. To list the cron job of a particular user, crontab -u USER -l So, we can control the minute, hour, day, etc, that it will execute.Īlso, each user has their own crontab. Usually, cron works as a time-based scheduler for Linux-based operating systems. Cron job executes a task at an interval or at a specific time. Here, our Support Engineers recommend CRON job to automate such daily tasks. However, to perform these tasks manually, it takes more time and effort.

Many clients want to perform regular tasks on their servers such as backups, running custom scripts and updating software, etc. Today, let’s get into the details and see how our Support Engineers fix crontab not sending an email. However, crontab not sending email is a common error that happens due to incorrect settings in the crontab file.Īt Bobcares, we often get requests to fix crontab not sending email as part of our Server Management Services.

An automated script can save time when doing repetitive tasks.Ĭron job comes as a boon while executing tasks at an interval or at a specific time.
