Linux scheduled task-ATD and crond

Source: Internet
Author: User

D. Generally, it indicates the service at the end.

Crond is usually used in many cases.

Open/etc and find the files and folders starting with cron.

 
Root @ iwissen:/etc # ls-LD cron * drwxr-XR-x 2 root Root 4096 Feb 7 18:03 cron. ddrwxr-XR-x 2 root Root 4096 Aug 21 cron. dailydrwxr-XR-x 2 root Root 4096 Aug 21 cron. hourlydrwxr-XR-x 2 root Root 4096 Aug 21 cron. monthlydrwxr-XR-x 2 root Root 4096 Aug 21 cron. weekly-RW-r -- 1 Root 718 Feb 7 18:03 crontab

Open the cron. daily folder and see what is in it.

 
Root @ iwissen:/etc # cd cron. daily/root @ iwissen:/etc/cron. daily # lltotal 16drwxr-xr-x 2 root Root 4096 Aug 21. /drwxr-XR-x 84 Root 4096 Feb 9 05:56 .. /-rwxr-XR-x 1 Root 372 Oct 5 2011 logrotate *-rwxr-XR-x 1 Root 1309 Oct 26 2010 sysklogd *

Many of them are scripts.

These scripts are executed every day.

Hourly is executed hourly. Monthly is executed every month and weekly is executed every week.

Use this method to create a periodic execution script

 
#/Etc/crontab: system-wide crontab # unlike any other crontab you don't have to run the 'crontab' # command to install the new version when you edit this file # And files in/etc/cron. d. these files also have username fields, # that none of the other crontabs do. shell =/bin/shpath =/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin # m h Dom mon Dow user command43 ***** root CD/& run-parts -- Report/etc/cron. hourly3 5 *** root test-x/usr/sbin/anacron | (CD/& run-parts -- Report/etc/cron. daily) 29 5 ** 7 root test-x/usr/sbin/anacron | (CD/& run-parts -- Report/etc/cron. weekly) 20 3 7 ** root test-x/usr/sbin/anacron | (CD/& run-parts -- Report/etc/cron. monthly)

* *****

Time-sharing day-month week
Crontab-e create a scheduled task

For example, execute a command every minute

* ***** "This will run every minute"

Crontab-l view scheduled tasks of the current user

For more information, see man.

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.