I’m calling a c program using crontab.
If I call the program directly, everything is fine.
If the program is called by cron, my .log files can’t be opened.
the program is in a directory
/stuff1/stuff2/stuff3/program
all pathnames in the program are absolute
just to make sure, I chmod 777’d everything in stuff3
EDIT:
The line from crontab is
0 * * * * /stuff1/stuff2/stuff3/program
EDIT2:
Issue isn’t with cron, if I run it like this
cd /
/stuff1/stuff2/stuff3/program
it fails
if I run it like this:
cd /stuff1/stuff2/stuff3/program
program
everything is peachy.
What does linux change that could affect my program when run in those two different ways?
The problem was that the program I was forking was attempting to write to ./
This caused permission failures as cron doesn’t run the program from the directory it is in, rather it runs it from some other directory that I didn’t have write permissions in.