Use the linuxat command on linux to regularly start the program

Source: Internet
Author: User
Cron is used to schedule duplicate tasks. the linuxat command is used to schedule one-time tasks within the specified time. To use the linuxat command, you must install the atRPM package and

Cron is used to schedule duplicate tasks. The linux at command is used to schedule one-time tasks within the specified time. To use the linux at command, you must install the at RPM package and the atd service must be running. You can use service atd start to start the atd service. To determine whether the software package is installed, run the rpm-q at command. To determine whether the service is running, run the/sbin/service atd status command.

How to configure a linux at command job:

To schedule a one-time job within a specified time period, type the at time command. The time here is the time when the command is executed. The time parameter can be in any of the following formats:

HH: MM format-for example, represents AM. If the time has passed, it will be executed at the time of the next day.

Midnight-stands for 12: 00 AM.

Noon-represents PM.

Teatime-stands for PM.

English month name date year format-for example, January 15 2002 represents January 1, January 15, 2002. The year is optional.

MMDDYY, MM/DD/YY, or MM. DD. YY format-for example, 011502 represents January 1, January 15, 2002.

Now + time-the unit of time is minutes, hours, days, or weeks. For example, now + 5 days indicates that the command should be executed after 5 days.

After you type the linux at command and its time parameter, the at> prompt appears. type the command to be executed, press the [Enter] key, and then press Ctrl-D, you can specify multiple commands by typing each command, pressing the [Enter] key, typing all commands, and then pressing the [Enter] key to transfer to an empty line, press Ctrl-D, or Enter the shell script after the prompt and press the [Enter] key after each line of the script, then press Ctrl-D in the blank line to exit.

Application instance:

  1. At 19:00
  2. At>/usr/local/f-prot/mnt/winc-report =/root/. xfprot/xfprot. log-dumb-archive-noserver
  3. At>
  4. Job 1
The above is a case of using the linux at command to regularly start the program on linux. I hope it will help you.
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.