Remove all `at` jobs
39,464
Solution 1
You can run this command to remove all the jobs at the atq
for i in `atq | awk '{print $1}'`;do atrm $i;done
Solution 2
You could do something like this:
for i in $(atq | cut -f 1); do atrm $i; done
Solution 3
This seems to me a short line:
atrm $(atq | cut -f1)
Solution 4
For more AIX 6 systems you can simply do:
atrm -
Solution 5
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
Related videos on Youtube
Author by
robob
Updated on September 18, 2022Comments
-
robob almost 2 years
I know that to remove a scheduled
at
job I have to useatrm "numjob1 numjob2"
, but is there an easy way to do that for all the jobs? -
David Jashi over 9 yearsIn FreeBSD it's
cut -f3
First column is date -
Sergiy Kolodyazhnyy about 9 yearsvariation on this answer
at -l | awk '{printf "%s ", $1}' | xargs atrm
-
Kusalananda over 4 yearsYou 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? -
Felipe over 4 yearsOk! 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.