synchronize is not deleting web Logs from SFTP Server

Advertisement

kdyer
Joined:
Posts:
2

synchronize is not deleting web Logs from SFTP Server

Have a server environment that does not have log storage. So, we SFTP web logs to the SFTP server and then pull them from the SFTP server.. The "to the SFTP" works great.

The "from the SFTP" is in question.

Here the script portion in question:

option batch abort
option confirm off 
open login@1.1.1.1
# binary

synchronize local -delete "/home/login/client/01/*.*" "D:\Program Files\Logs\ClientServer01\"
synchronize local -delete "/home/login/client/01/subfolder/*.*" "D:\Program Files\Logs\ClientServer01\subfolder\"
synchronize local -delete "/home/login/client/01/tomcat/*.*" "D:\Program Files\Logs\ClientServer01\tomcat\"

so basically the process never moves (or even copies) the files from the SFTP Server to the log store.

Thanks!

Reply with quote

Advertisement

Guest

Re: synchronize is not deleting web Logs from SFTP Server

I think I have a way to get around this and seems to work. Here is how I modified the script:
option batch abort
option confirm off 
open login@1.1.1.1
binary
get -delete  "/home/login/client/subfolder/*.*" "D:\Program Files\Logs\ClientServer01\subfolder\"

Thanks!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: synchronize is not deleting web Logs from SFTP Server

The synchronize commands takes a local path as the first argument and a remote file as the second.
See https://winscp.net/eng/docs/scriptcommand_synchronize

You have them the other way around.

Anyway, the synchronize -delete probably does not do what you want.

Your solution with get -delete is probably correct. Though your requirement is quite vague, so I'm not really sure what you want to do.

Reply with quote

kdyer
Joined:
Posts:
2

I figured this out.
The
get -delete
did work.
We placed the main hourly log archive files into a "root" location which removed extra folders. Created a folder called files and the get -delete won't delete the extra folders.

Reply with quote

Advertisement

You can post new topics in this forum