Crontab timed task script does not execute, log has no execution record

Source: Internet
Author: User

In Linux under the crontab to start a timed script, put in the crontab of dead and dead did not respond, this is the possible reason:

1, look at the log, Cat/var/log/cron. If there is an execution record in the log, it may be that the script does not have permission to execute, giving execution permission, such as chmod +x xxx.sh, which gives the xxx.sh script permission to execute.

2, look at the log, no response to the log, no script execution record, crontab-l View list no problem, Crontab is also running state, the possible reason is that the editing time task with the Chinese space, the best solution crontab-e into the editing interface, the task was deleted to write again , remember, must not bring Chinese.

3, there may be a script at the beginning of the #!/bin/bash write wrong, such as #/bin/bash write less.

Some of the internet is caused by environmental variables, if the above methods do not work, you can Baidu environmental variables to solve the problem.

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.