Solved at command can not run the shell script

Hi all
When I run this code the shell script does not work.
sudo at -t 200201010102 -f /test.sh

The output of date command is:
Code:
Tue Jan  1 01:00:01 IRST 2002

The script is:
Code:
    #!/bin/sh
    shutdown -r now

The user that I run the at is test. I give the permission in sudoers file to the user test.
When I run the command it has no error. At the given time I execute atq and the job disappear correctly.

What is wrong?

Thanks
 
Looks like the path to the script is incorrect, you're trying to start /test.sh, I very much doubt you have stored this script in the top root directory (/).

Also note that the date is in 2002, that's 16 years ago.
 
yes, you're right. In the real code the path is different. It's /usr/local/etc/test.sh.
is it important what the date is?
 
Thanks all,
I solve the problem by adding a user named "daemon:wheel" and mkdir -p /var/at/{jobs,spool} and chown -R daemon:wheel /var/at/
 
Back
Top