I have a script which ssh to a remote machine,and runs a binch of scripts.This works fine when I run the actual ssh command from the command line.It also runs fine when the script is executed.
However,when I create a cron job that calls this script- it does not seem to work.
This is the ssh command:
ssh -v mqmgr\@server -C "/bin/tcsh -c 'cd $path/setup;sourceset_env.sh;cd ../scripts;./code_name_update.pl;./export_and_load.sh'"`;
After this ssh call the next thing that is done,is sending mail.The export_load.sh which is the last script that is run,creates an output file.This file is created ,however,the next statement,ie sending mail is not executed.
When I run a pstree -p | grep ssh - I see that the sshd is still there.I am not sure what is blocking it ?Why is the next statement not being executed,despite all the scripts being run on the remote machine.