Hi,
Thanks for that. I am now able to archive the files in the remote server using the below commands in the script. Pasting the section from the script
Remote2Local() {
cd ${FILES_PATH} 2>/dev/null
if [[ ${?} -gt 0 ]];then
print -u2 "LocalSource path not found";
rm ${LCK_FILE}
exit 1;
fi
echo cd ${FILE_SOURCE_PATH} > ${TMP_SFTP_SCRPT}
echo mget ${FILE_MASK} >> ${TMP_SFTP_SCRPT}
# echo rm ${FILE_MASK} >> ${TMP_SFTP_SCRPT} Commented this line as part of the changes
echo bye >> ${TMP_SFTP_SCRPT}
sftp -oPort=${FILE_SOURCE_PORT} -b ${TMP_SFTP_SCRPT} ${FILE_SOURCE_ACCOUNT} 2>/dev/null 1>&2
rm ${TMP_SFTP_SCRPT}
# Changes added to archive the files to �rchive' folder in the source path
echo cd ${FILE_SOURCE_PATH}/archive > ${TMP_SFTP_SCRPT}
echo mput ${FILE_MASK} >> ${TMP_SFTP_SCRPT}
echo bye >> ${TMP_SFTP_SCRPT}
sftp -oPort=${FILE_SOURCE_PORT} -b ${TMP_SFTP_SCRPT} ${FILE_SOURCE_ACCOUNT} 2>/dev/null 1>&2
rm ${TMP_SFTP_SCRPT}
# End of change
}
In the code when I comment the 2>/dev/null 1>&2, I am able to see the attached information in the server. I would like to have similar information saved to a log file in remote server. Could you please help me with that?