Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of at and atq commands in Linux system

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "the usage of at and atq commands in Linux system". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

At

At executes the command at a specified time.

-V lost the publication number on the standard error.

-Q queue uses the specified queue. A queue is calibrated with a letter, and valid queue calibration ranges from a to z and from A to Z. The default queue for at is aQuery batch, and the default queue is b. The higher the alphabetical order of the queue, the more modest the queue runs (the lower the level of run). The specified queue "=" is reserved for the queue where the currently running job resides. If a job is submitted to a queue marked in uppercase letters, it is treated as if it were submitted to batch. If you assign a queue to atq, only the jobs in that specified queue are displayed.

-m sends an email to the user even if there is no output when the job is completed.

-f file reads job information from a file instead of standard input.

-l is equivalent to atq.

-d is equivalent to atrm.

-v for atq, displays the complete jobs that have not been deleted in the queue, and for other commands, displays the time that the job will be executed. The format of the time displayed is similar to 1997-02-20 14:50, but if the POSIXLY_CORRECT environment variable is set, the format is similar to Thu Feb 20 14:50:00 1996.

-c connects the jobs listed on the command line and outputs to standard output.

Example:

After 10 minutes, output 1111

The code is as follows:

[zhangy@BlackGhost ~] $at now + 10 minutes

At > echo 1111

At >

Job 3 at Fri Apr 26 12:56:00 2013

Timed list of at

The code is as follows:

[zhangy@BlackGhost ~] $at-l

3 Fri Apr 26 12:56:00 2013 a root

View the contents of a single at task

The code is as follows:

[zhangy@BlackGhost ~] $at-c 3

#! / bin/sh

# atrun uid=0 gid=0

# mail tnak 0

Umask 22

. Omit.

Echo 1111

Delete at task

The code is as follows:

[zhangy@BlackGhost] $at-d 3

Atq

Example:

View at tasks

The code is as follows:

[zhangy@BlackGhost ~] $at now + 10 minutes

At > echo 1111

At >

Job 3 at Fri Apr 26 12:56:00 2013

The code is as follows:

[zhangy@BlackGhost ~] $atq

3 Fri Apr 26 12:56:00 2013 a root

This is the end of the introduction to the usage of at and atq commands in the Linux system. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report