Topic "synchronize is not deleting web Logs from SFTP Server"

Author Message
kdyer
[View user's profile]

Joined: 2006-08-30
Posts: 2
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:

Code:
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!
Advertisements
Guest




I think I have a way to get around this and seems to work. Here is how I modified the script:
Code:
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!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
The synchronize commands takes a local path as the first argument and a remote file as the second.
See http://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.
kdyer
[View user's profile]

Joined: 2006-08-30
Posts: 2
I figured this out.
The
Quote:
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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License