Removing all at jobs except the ones running?

Bo Berglund bo.berglund at gmail.com
Mon Mar 7 08:12:19 UTC 2022


I am scheduling jobs to be executed using at and this works fine mostly.

But sometimes I want to reset the at job list and I have found this command to
ease this when the at job list is long:

atq | cut -f 1 | xargs atrm

I have put it into a utility script atremoveall for ease of use.

But since atq lists also the *running* jobs it will attempt to remove also
these, which I don't want.

How can I exclude running jobs from removal while still being able to remove all
queued jobs easily?


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list