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 and then pressing the [Enter] key. After entering all the commands, press the [Enter] key to transfer to an empty line, and then press Ctrl-D. Alternatively, you can Enter the shell script after the prompt, press the [Enter] key after each line of the script, and then press Ctrl-D in the blank line to exit.
Application instance:
At 19:00
At>/usr/local/f-prot/mnt/winc-report =/root/. xfprot/xfprot. log-dumb-archive-noserver
At>
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.
- Linux at command details and Use Cases
- Use the Linux at command in the Linux operating system to regularly send emails
- Usage of cron and linux at commands in linux