I got a script which will SFTP file.gz.tmp file from the Solaris box to AIX box and then it will rename via SFTP the filename.gz.tmp to filename.gz
ulimit -n 1023; ulimit -d unlimited; /usr/atria/bin/cleartool setview -exec "/vobs/admin/bin/CC_MS/ccms_sync.pl -c export -o rpc1_new" ccv4bin >>$HOME/logs/ccms_sync.log 2>&1
When I run the script manually, SFTP works perfectly, but if the script is cron'ed, SFTP is failing while renaming the file.
Uploading admin_rpc1_new_130121204001.pkg.gz to /viewstore/cmadmin/CC_MS/CC_MS_IN/admin_rpc1_new_130121204001.pkg.gz.tmp
sftp> rename admin_rpc1_new_130121204001.pkg.gz.tmp admin_rpc1_new_130121204001.pkg.gz
Couldn't rename file "/viewstore/cmadmin/CC_MS/CC_MS_IN/admin_rpc1_new_130121204001.pkg.gz.tmp" to "/viewstore/cmadmin/CC_MS/CC_MS_IN/admin_rpc1_new_130121204001.pkg.gz": Failure
ERROR: sftp file transfer to server XXXX failed.
I also checked in the $HOME/.profile and couldn't find any additional settings. Additionally the .profile got ulimit -n 1024.
Have anyone encountered this kind of SFTP error before?
Please let me know what kind of check will be useful to narrow down the issue.
Thanks in advance.