I know that to remove a scheduled at job I have to use atrm "numjob1 numjob2", but is there an easy way to do that for all the jobs?


6 Answers 6


You can run this command to remove all the jobs at the atq

 for i in `atq | awk '{print $1}'`;do atrm $i;done
  • 2
    variation on this answer at -l | awk '{printf "%s ", $1}' | xargs atrm Apr 24, 2015 at 10:11

You could do something like this:

for i in $(atq | cut -f 1); do atrm $i; done
  • In FreeBSD it's cut -f3 First column is date Oct 26, 2014 at 9:51

This seems to me a short line:

atrm $(atq | cut -f1)

For more AIX 6 systems you can simply do:

atrm -

Ref: http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds1%2Fatrm.htm


Here is my xargs version that avoids braces and is hopefully intuitive:

atq | cut -f 1 | xargs atrm

You can also grep specific jobs by timestamp/userid and then remove them:

atq | grep "2018-10-22 16:" | cut -f 1 | xargs atrm

I had more than 58k jobs in the atd (someone rebooted the server and for some reason atd service not started). Removing the jobs using atrm is very painful for very high queue.

I stopped atd and deleted all dirs from /var/spool/atjobs and files from /var/spool/atspool . For me it worked.

rm -rf /var/spool/atjobs/* ; rm /var/spool/atspool/*
  • You never say anything about starting up atd again, and whether that was successful, nor do you mention what Unix this would be an adequate solution for. How did you make sure that other users' jobs were not deleted?
    – Kusalananda
    Oct 25, 2019 at 12:28
  • Ok! Sorry! Need to start atd after the process. My solution is for "SUSE Linux Enterprise Server 12". But I think it can use in other distributions. I found the information of directories in "man". In my situation, only root is using atd, then removing the files was safe.
    – Felipe
    Oct 25, 2019 at 12:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .