PUT latest file on sftp site

Advertisement

skumarlingam
Joined:
Posts:
5
Location:
NC

PUT latest file on sftp site

Hello experts,

Please let me know where went wrong in below code.

I am trying to upload only latest file out of all .bkp files. Each .bkp file generates every 15 minutes. I need to pickup latest .bkp file from list of files.

# Connect to SFTP server using a password
open sftp://wonder:Password;fingerprint=ssh-dss-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00@ftp.xyz.com/test/uploadfilehere/
# Upload file
lcd D:\Shares\takefilefromhere\
put *.bkp /test/uploadfilehere/ latest -nopreservetime
exit

Thank you in advance.

Reply with quote

Advertisement

skumarlingam
Joined:
Posts:
5
Location:
NC

sorry small change in my code

# Connect to SFTP server using a password 
open sftp://wonder:Password;fingerprint=ssh-dss-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00@ftp.xyz.com/test/uploadfilehere/ 
# Upload file 
lcd D:\Shares\takefilefromhere\ 
put *.bkp /test/uploadfilehere/ -latest -nopreservetime 
exit

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,096
Location:
Prague, Czechia

Re: PUT latest file on sftp site

The code looks good. If it does not do what you want, you have to tell us what it does and what you expected different. Also, attach a log file.

Reply with quote

Advertisement

You can post new topics in this forum