Hello,
If i run the following script from the cmdline it works just fine however if i run it via root cronjob it doesn't write to the file at all. It is chmod 777 now so shouldnt be any right issues.
Ye i am checking in the test.log file.
It writes there just fine if i do it from cmdline, not sure why cronjob isn't picking it up. Is there anyway to see what the cronjob says about it?
does your script have PATH variable set or at least the commands have their full paths (i.e., /bin/hostname instead of hostname , /usr/bin/rm instead of just rm , etc.)? if yes, look at something else in your current environment that will not be there should cron run your script and then account for it inside your script ...
the MTA (mail transfer agent) issue does not seem to be related to your script as it shows up in the logs more than a few minutes before your script runs and the script/program creating the log entries is doing some editing -- most likely a sql maintenance script -- while your top script does not ... besides, the script you posted does not send email so there would be no need for MTAs ...
change 2> /dev/null in your cronjob listing to 2> /shellScripts/test.err.log and see if there are any errors logged in the error log ...
Hi again,
I've no idea what actually made it work but i tried a ton of stuff including both of your suggestions so something obviously did the trick. I'm grateful for your assistance, and if i find out the specific reason why it now works i'll post it here for somebody else in the future.