We are praparing a script to move a file from AIX 6.1 to other system.
we are using the below script"put_etransfer.ksh"
#!/usr/bin/ksh
sftpdate=`date +"%Y%m%d%H%M"`
filename=hsa-selectacc.asc
logfile=/home/data/interfaces/log/etransfer_$sftpdate.log
cd /home/data/usinterfaces/out
if ! -e $FILENAME
then
print "ERROR - $FILENAME does not exist."
print "Exitting ..."
exit 1
fi
/usr/local/bin/sftp -B /home/hrdata/scripts/USsftp/cmdc.sftp qaz00100@move.etransfer.com >> $logfile
here cmdc.sftp conatains below commands
binary
ls -l
put hsa-selectacc.asc
exit
==========================================================
when we execute put_etransfer.ksh we get error message
./put_esecuretransfer.ksh
Error: Could not open connection to `qaz00100@move.etransfer.com': Could not connect to `move.etransfer.com': Disconnected by application
when I change the script to
#!/usr/bin/ksh
sftpdate=`date +"%Y%m%d%H%M"`
FILENAME=hsa-selectacc.asc
logfile=/home/hrdata/usinterfaces/log/etransfer_$sftpdate.log
cd /home/hrdata/usinterfaces/out
if ! -e $FILENAME
then
print "ERROR - $FILENAME does not exist."
print "Exitting ..."
exit 1
fi
sftp qaz00100@move.etransfer.com
and execute the script put_etransfer.ksh
It will ask for password and if I provide the password it will get connected but i need to give the command put hsa-selectacc.asc
Can any one help me on this.
Thanks inadvance
Viswanath
we are using the below script"put_etransfer.ksh"
#!/usr/bin/ksh
sftpdate=`date +"%Y%m%d%H%M"`
filename=hsa-selectacc.asc
logfile=/home/data/interfaces/log/etransfer_$sftpdate.log
cd /home/data/usinterfaces/out
if ! -e $FILENAME
then
print "ERROR - $FILENAME does not exist."
print "Exitting ..."
exit 1
fi
/usr/local/bin/sftp -B /home/hrdata/scripts/USsftp/cmdc.sftp qaz00100@move.etransfer.com >> $logfile
here cmdc.sftp conatains below commands
binary
ls -l
put hsa-selectacc.asc
exit
==========================================================
when we execute put_etransfer.ksh we get error message
./put_esecuretransfer.ksh
Error: Could not open connection to `qaz00100@move.etransfer.com': Could not connect to `move.etransfer.com': Disconnected by application
when I change the script to
#!/usr/bin/ksh
sftpdate=`date +"%Y%m%d%H%M"`
FILENAME=hsa-selectacc.asc
logfile=/home/hrdata/usinterfaces/log/etransfer_$sftpdate.log
cd /home/hrdata/usinterfaces/out
if ! -e $FILENAME
then
print "ERROR - $FILENAME does not exist."
print "Exitting ..."
exit 1
fi
sftp qaz00100@move.etransfer.com
and execute the script put_etransfer.ksh
It will ask for password and if I provide the password it will get connected but i need to give the command put hsa-selectacc.asc
Can any one help me on this.
Thanks inadvance
Viswanath