Linux crontab file location and log location

Source: Internet
Author: User

I. File location

Location in general under the/var/spool/cron/, if you are the root user, then there is a root file, recommended daily backup, to avoid accidental deletion resulting in crontab file loss;

Two. log file location

By default, the logs executed in Crontab are written under/var/log, such as:
#ls/var/log/cron*
/var/log/cron/var/log/cron.1/var/log/cron.2/var/log/cron.3/var/log/cron.4

The crontab log is simple and sends a message to the user when Crond performs a task failure. It happened that one of our servers found that a task was not performing properly and that Crond e-mail failed. By looking at the mail log, you see that there is insufficient disk space.
You can increase the number of tasks in each crontab by adding your own log, which is useful for finding the cause of execution failure.
0 6 * * *//root/script/ss.sh >>/root/for_crontab/mylog.log 2>&1
Output both the error output and the standard output to the MyLog.log.

If Crontab does not succeed, detects if the crontab service is started,

/etc/init.d/crond status

/etc/init.d/crond restart

Cron is the system daemon, location:
/etc/init.d/crond
Parameters:
Start
Stop
Restart
Reload
Wait a minute

Reproduced in: 7713072

Linux crontab file location and log location

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.