Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

kdyer

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.
martin

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.
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!
kdyer

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!