Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

editing an existing "at job "

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there,

I was wondering if there is anyway to edit an existing "at job" in Unix/Linux.

The atq command will give us a list of "at jobs" that are currently scheduled,

and at -c [job number] shows us the actual content of the job.

Is there such a command to edit a job that is waiting to be executed?
 
Maybe.

You can't with the [tt]at[/tt] command itself. I don't know about Linux, but in Solaris the at jobs will be in the directory [tt]/var/spool/cron/atjobs[/tt]. If you look at the job, the [tt]at[/tt] command has thrown a bunch of stuff into it to make it run right. That include your environment variables, setting your working directory, setting your [tt]umask[/tt], and other things.

I'm sure you can edit it, but there are some things to be aware of and get past. The script is a SUID script with the owner being the person that submitted it. So only the submitted or [tt]root[/tt] can edit it. There's no write permission on the file, so you'll have to change that. The directory it's in is owned by [tt]root[/tt], so that may limit what you can do.

BUT, why don't you just try it. That's the best way to find out.
 
On Linux it seems to be in [tt]/var/spool/at/spool[/tt]. It looks like you'll need to be [tt]root[/tt] to get to the file.
 
Easiest way I see, is to remove the job (at -r) and re-schedule an updated version of it.

atq to list jobs (that's "at -l" on AIX)
at -c (jobname from list) >/tmp/atfile ("at -v -l (jobname)" on AIX)
at -r jobname
vi /tmp/atfile
at date/time-spec </tmp/atfile


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top