I am trying to make the at
bash command to run, but it is not working for me. I can add a job to the queue, but it is not run when the time is up. What am I doi
It is working fine. It's just that commands running with at
don't write their output to the terminal that you called it from.
Try:
at now +2 minutes
echo TTTEEEST > new_file_test
You'll see the file appear in two minutes.
I've found this here
First make sure that the at daemon is running using a command like this:
# ps -ef | grep atd root 8231 1 0 18:10 ? 00:00:00 /usr/sbin/atd
If you don’t see atd running start it with this command:
# /etc/init.d/atd start
Check your mail:
An at - or batch - command invoked from a su(1) shell will
retain the current userid. The user will be mailed standard
error and standard output from his commands, if any. Mail
will be sent using the command /usr/sbin/sendmail. If at is
executed from a su(1) shell, the owner of the login shell
will receive the mail.
Take a look at /var/at/jobs
and see if your at jobs are listed there. (It may be a different directory based upon OS).
By default, at
isn't enabled on most systems. In order for at
jobs to actually get executed, the atrun command must execute.
This command is executed either through launchd or through the cron depending upon the system.
The exact mechanisms are different from system to system, so you'll have to read all the various manpages on at
, atrun
, etc. to verify if at
is really enabled on your system, and whether you have permissions to run at jobs. There's normally both an ant allow and an ant deny file on your system, so you need to check both. You must be both in the allowed file, and also not in the deny file.
On top of that, you have to make sure that at
is even enabled on your system (due to security concerns, it is usually disabled).
To analyze at(d) execution problems it may help to
man at.allow
)systemctrl -a | grep atd
on Ubuntu)tail -f /var/log/syslog
(at execution time)journalctl -b | grep atd
(found that here, contains further hints)The "Permission denied" error may also be caused by limited number of logins defined (for the at
running user) in /etc/security/limits.conf.