2

I am scheduling, say, 3 commands using at command.

$ at teatime
 command1
 command2
 command3
 <Ctrl + D>

After some time I realised that running command3 is not really what I wanted, but at same time I don't want remaining commands to stopped from execution.

I tried looking for at command or something like it in System Monitor so that I could kill process responsible for running command3 but couldn't find (maybe I am wrong in this). Also I can stop ATD daemon that runs these commands but that will stop all commands from execution, which is not what I wanted.
Is there any other way to stop just command3 ?

Alex Jones
  • 6,353

1 Answers1

3

The easiest solution would be to cancel all three and re-schedule the ones you want executed. atq will show you the list of queued tasks, at -c will show you one queued task by number, and atrm will remove one task by number.

Your underlying problem is that everything from invocation of at to the ctrl-d is, in essence, put into a single shell script, which usually resides somewhere under /var/spool, and I think that at has some protection against these files being modified after being submitted, though I do not recall the details. (I guess that could be tried out experimentally if you have root access on your machine -- find the file containing your commands and comment out the one you don't want to execute.)