Crond do not perform cause analysis

Source: Internet
Author: User

Wrote a script, let Crond to periodically execute the script to backup, but in the crontab-e inside the execution script, found that no execution, and later analyzed, Crond not perform the main reasons are as follows:

1, Crond service did not start

Service Crond Start//Startup services
Service Crond stop//Shutdown services
Service Crond restart//Restart services
Service Crond Reload//Reload Configuration

2. User does not have permission to perform Crond

The/etc/cron.deny file is used to control which users cannot perform the functions of the Crond service.

You can delete yourself from the file, or contact root

3. Crontab does not provide environment variables for the executing user

Workaround: Add the following line to the script:

. /etc/profile
4. Absolute path not used

The absolute path here includes the path in the script and two aspects of the path in the Crond command.

5. If none of the above solves the problem, you can look for the problem again:

1) go to the mail to see, in the process of the user should receive the message, such as receiving such a prompt:

You have mail in/var/spool/mail/root

Go look inside, there's crond.

2) Add output to the script to debug

You can add an echo $PATH >/tmp/test.log to the crontab script

echo $PATH for executing scripts in contrast and terminal

Crond do not perform cause analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.