Hi all,
I have the following shell script code which tries to sftp and writes the log into the log file.
Code:
TestConnection ()
{
echo 'Connection to ' $DESTUSERNAME@$DESTHOSTNAME
$SETDEBUG
if [[ -a $SCRIPT ]]; then rm $SCRIPT ; fi
touch $SCRIPT
echo "cd" $REMOTEDIR >> $SCRIPT
echo "quit" >> $SCRIPT
chmod 700 $SCRIPT
sftp -b $SCRIPT $DESTUSERNAME@$DESTHOSTNAME > $SESSIONLOG
echo '**** FTP log reproduced below:'
echo '-----------------------------------------------------------'
cat $SESSIONLOG
echo '-----------------------------------------------------------'
}