Question

I am trying to test the at command with the following:

echo 'touch hi' | at now + 1 minute

I receive back a job id and time : job 7 at Wed Sep 11 01:35:00 2013.

But when I ls after the time has passed, I don't see the new file hi.

What gives?

Était-ce utile?

La solution

First of all, is your atd running, the daemon that is responsible for running scheduled jobs?

Is the job still showing up in your queue via atq?

Have you received an error email (at is supposed to send you a local email with the output of your job, which may include error information)?

Plus, notice that the jobs are run in the default environment of your user, which usually means in your home directory, not in the current directory.

I have found it to be occasionally unreliable to assume that your whole environment is properly retained, including the current working directory. If you want to play safe, try using absolute path names, and make sure your script works with the default POSIX shell.

In my experiment just now, the hi file was created in the current directory, so it actually worked as expected for me (including environment and $PWD).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top