Hi,
I have a script that's being called via a crontab which is a wrapper script that creates a log for the script that gets executed. Within the script that gets executed, it also run's subscripts. I've been able to get everything to work .. but the issue is one of the subscript that goes out and does a set of remote ssh connections to run a local script on servers, the output currently is being re-directed back to a file local to the system of execution, the problem is when the cron run's I know the output is being generated but it does not redirect to the local file. The file gets generated but they're all blank. I've tried to troubleshoot each script at a time and if I run the wrapper script manually, everything works, but when cron executes the script outputs these 0byte files.
I've tried:
ssh root@$i /tmp/subscript.sh >> /local/file
ssh -n root@$i /tmp/subscript.sh >> /local/file
ssh root@$i /tmp/subscript.sh &> /local/file
ssh root@$i /tmp/subscript.sh > /local/file 2>&1
I've tried many different method but I've just been left with manually running the wrapper script few times out of the day vs. having it automated.
I don't know how else I could troubleshoot or figure a way to re-direct the output from the remote ssh connection back to a local file that works under a crontab?? Any suggestions?