Why does the crontab scheduled task under freebsd fail to be executed automatically?

Source: Internet
Author: User

The crontab scheduled task under freebsd cannot be automatically executed for troubleshooting. Two scheduled tasks were configured last night. One root user, one common user, and two scripts were executed on the terminal, but at work in the morning, I found that neither of the two tasks was automatically executed, which is quite strange. I checked/var/spool and found that cron did not send me an email, which indicates that the scheduled task was not executed. Www.2cto.com: Check the cause. In the script, all the command paths are full paths without relative paths. The shell uses c shell, which is no problem. So I set my scheduled task to run once every minute to see if it has been called: Java code */1 *** xxxx, then, keep checking cron logs. Java code: tail-f/var/log/cron. There is no movement at all. Why? After thinking about it, it is possible that the cron service has not been started, because it is newly configured to the server, and may not be set to boot automatically. Restart www.2cto.com with Java code/etc/rc. d/cron restart: Check the cron log again. The Java code tail-f/var/log/cron shows that the scheduled task configured by me can be executed normally. Then, modify the execution time of the scheduled task. Then, you do not need to restart the cron service. Cron scans user-set scheduled tasks every minute and automatically loads them.

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.