I have a ksh script running on a Linux box. The last step of the script is to set-up an at job to run the script at 9.30 the following day.
I had a similar script in dev before where i said at -s -f /run_script > nohup and it worked fine. So when creating the new file i did the same but left out the -s option as it still worked and at the time i didn't know what -s was for. When I deployed to production a weird but was spotted - when the script was ran from command line it scheduled itself correctly for the following day. the script would run automatically the next day but not schedule itself. weird! The only difference is it's on a different box and it no longer has the -s option.
After some goggling i found out the -s option forces the at job to be run in the Bourne shell. Thats ok! but when I add the -s option I now told there is no such option. Any ideas?
The following options are supported. If the -c, -k, or -s options are not specified, the SHELL environment variable by default determines which shell to use.
-c C shell. csh(1) is used to execute the at-job.
-k Korn shell. ksh(1) is used to execute the at-job.
-s Bourne shell. sh(1) is used to execute the at-job."
Ok, I thought you mentioned in your question that you are working on linux and not solaris. On solaris and some other unix platforms, the at command gives the user the option to choose the shell that will be used to execute the job or script. This is not available on linux with the at command (you can always choose which shell to execute the script with using the #!/usr/bin/shellname).
You should have seen an error message on linux when you have used the -s option.