Is there an efficient way of to remove multiple atjobs?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • We have accidentally created a large (+230K) number of at jobs.
  • Removing them using 'atrm ' is very time consuming - is there a faster way?

Resolution

  • All spooled jobs are stored under /var/spool/at, for example:
# ls -la /var/spool/at
  total 28
  drwx------.  3 daemon daemon 4096 Jul 18 11:04 .
  drwxr-xr-x. 13 root   root   4096 Jan  2  2013 ..
  -rwx------.  1 root   root   2802 Jul 18 11:04 a0000101657ede
  -rwx------.  1 root   root   2797 Jul 18 11:04 a0000201657961
  -rwx------.  1 root   root   2797 Jul 18 11:00 a0000301657ed9
  -rw-r--r--.  1 root   root      6 Jul 18 11:04 .SEQ
  drwx------.  2 daemon daemon 4096 Jan 20  2012 spool
  • In this example, you should be able to delete (or move to another location) all the a000* files. The .SEQ file and spool directory should remain.

Root Cause

  • It may also help to disable atd while deleting jobs, ie:
service atd stop
# delete jobs
service atd stop

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.