The use of Linux crontab

Source: Internet
Author: User
The use of Linux crontab

Preparation (Lab building needs, actual environment not required):
sudo service rsyslog start
sudo cron-f &

Crontab use
Add Task: CRONTAB-E
Add a line: */1 * * * * touch/home/shiyanlou/$ (date +\%y\%m\%d\%h\%m\%s)
View tasks: Crontab-l
Monitoring execution: PS aux | grep cron
Monitoring Log feedback information: sudo tail-f/var/log/syslog
Delete Task: Crontab-r

Additional:
The role of each directory:
/etc/cron.daily, the script in the directory executes once a day and runs at 6:25 each day;
/etc/cron.hourly, the script in the directory executes once per hour and runs at 17 minutes per hour;
/etc/cron.mouthly, the script in the directory will be executed once a month and run at 6:52 on the monthly 1th;
/etc/cron.weekly, the script in the directory executes once a week and runs 6:47 on the seventh day of the week;

The use of Linux crontab

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.