We have several data crunching openSuSE 10.3 computers. Users submit “at” jobs and wait for the result. The atd daemon stores the job output in the /var/spool/atspool directory with permissions that only allow root to read them (600). This is a problem because the people submitting the jobs often need to monitor the progress. (It is even helpful to see each others jobs in progress.) Right now we need to give out the root password to all users to be able to monitor the jobs. It would be much better if the umask of atd could be changed to allow anyone to read the output files. I tried putting umask in a .bash_profile file in the /var/spool/atjobs (this is the default home directory of the user “at”. I also tried putting the umask command in the /etc/init.d/atd file’s start section. (Then I stopped and started atd.) Neither of these ideas worked.
If users want to see the output from their jobs, they should not rely on the mail that’s sent to them at the end of the job, but write the job in such a way so that output goes to a file of their choice. Something like this will work as the script. Then nothing is mailed to them, and everything goes to $HOME/myjob.out.
exec > $HOME/myjob.out 2>&1
command1
command2
etc, etc
That is an interesting approach. However, there are reasons we prefer to have the output mailed. There is often a distribution list for the mail. In addition we like the way the atd daemon handles the queuing of jobs. Therefore, I am still interested in learning a way to have the atd create these output spool files with group or world readable permissions.
In case you didn’t understand, those lines were supposed to be submitted to at.
You can still have your cake, just mail the output at the end of the job.
exec > $HOME/myjob.out 2>&1
command1
command2
etc, etc
mail -s ‘At job’ $USER < $HOME/myjob.out
Ok. I was not aware that you were suggesting that those commands be run under the at command.
I found out why none of those umask methods I had tried worked. Three cheers for open source. <:)<:)<:) I downloaded the source to atd and discovered that the permissions of the file create are quite specific. So I changed the program to create the file differently.