I've noticed that when running a script that connects to a number of our servers (to essentially run batch commands) that the commands aren't logged in the user's .sh_history or .bash_history files. Is there a place where this is logged (assuming the script itself isn't doing the logging and I'm not tee'ing the output anywhere)?
I'm talking specifically about AIX, but I would assume this question applies to all the *nix flavors.
As a tag-along to this post, I often nohup these commands (like sendmail -bi) so the script can run through all the hosts quickly. What can I enter in the script to create one large nohup.out on the machine running the script that's reaching out to all the others?Right now I've got
for node in `cat /home/root/script/shortlist`
#for node in `cat /usr/local/bin/AIX_server_list`
do
echo $node
ssh $node lssrc -s sendmail
echo "***"
ssh $node cp /etc/aliases /etc/aliases.old
scp -p /etc/aliases $node:/etc/aliases
ssh $node nohup sendmail -bi &
ssh $node lssrc -s sendmail
ssh $node cat /home/root/nohup.out >> ~/script/sendmailbi_log.txt
echo "%%%%%%%%%%%%%%%%%%%%%%%%"
done
but that failed miserably, I'm guessing that's because the nohup was given via an ssh and not in an interactive shell so nothing got logged?