How to execute specific tasks at specific times in Linux

Source: Internet
Author: User
In Linux, how does one execute a specific task at a specific time. comatd service at command to start atd # serviceatdrestartatdstop/waitingatdstart/running, process11031 10 million attention to be executed under the root ,... in Linux, how does one execute the program www.2cto.com atd service at required for a specific task at a specific time? 1. start atd # service atd restartatd stop/waitingatd start/running, process 11031 must be executed under root, otherwise the system will prompt Rejected send message. at is used to use at permissions (because it is best to set security considerations) at/etc/. set the account that can use at In allow in/etc/. in deny, run the mkdir $ at now + 1 minuteswarning: commands will be executed using/bin/shat> mkdir helloAtat> command one minute later. Job 1 at Wed Feb 6 14:36:00 2013 view work # at-c 2 #! /Bin/sh # atrun uid = 0 gid = 0 #... $ mkdir helloAt shutdown at a specific time $ at 2013-2-9warning: commands will be executed using/bin/shat>/bin/syncat>/sbin/shutdown-h nowat> Job 4 at Sat Feb 9 14:00:00 2013at how to execute input and output: the standard input and output will be redirected to mailbox, so running echo "hello" is invisible to the background in the terminal: the system will assign the at statement to the atd program to take over. even if the shell is off, it does not matter to query and delete the at statement: atq delete: atrm jobidbatch: similar to, only when the cpu load is low can the crontab permission of the program required to execute the 2-cycle task www.2cto.com be restricted./etc/cron. allow/etc/cron. deny example $ crontab-e # Add a task to the editing environment and use the vim editing format: # m h dom mon dow commandm: minute, h: hour, dom: day of monthmon: month, dow: day of week task example: 0 5 ** 1 tar-zcf var/backups/home. tgz/home * indicates any time $ crontab-l # Query task $ crontab-r # DELETE task 3 can wake up the work task anacron during shutdown: crontab task not executed because of shutdown, anacron can detect non-executed crontab tasks at startup and execute them all once.
 
Related Article

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.