Topic "Synchronize local with remote using the batch file"

Author Message
TK

Guest


Hi,
I have files in the ftp session and they get updated/changed from time to time using a 3rd party system.

I want to sync the local foler with the FTP path

I am using the following command

synchronize local "E:\xxx\yyyy\zzzz\" "/yyyy/zzzz/"

This is bringing down the files BUT if a files is delete from the FTP it is not deleting in the local

Bacially it is not Updating the local

How can I achieve that
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
synchronize local -delete ... ...

Please read documentation:
https://winscp.net/eng/docs/scriptcommand_synchronize
_________________
Martin Prikryl
TK

Guest


prikryl wrote:
synchronize local -delete ... ...

Please read documentation:
https://winscp.net/eng/docs/scriptcommand_synchronize



Hi,
Thank you for the reply
and can you help me understand better

So.. does it mean
synchronize local -delete "E:\xxx\yyyy\zzzz\" "/yyyy/zzzz/",


a>Will Copy down the latest files from Remote to Local
b>Will Update the changed files to Local
c>Will delete the local files if the they are deleted on Remote?

One more problem I am facing with synchronize local "E:\xxx\yyyy\zzzz\" "/yyyy/zzzz/", command is - Everytime when I execute the command it is trying to copy all the files, Even if the files already exists on the Local.
How can I eleminate this ?

Thank you for the support
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
TK wrote:
a>Will Copy down the latest files from Remote to Local
b>Will Update the changed files to Local
c>Will delete the local files if the they are deleted on Remote?

Correct.

Quote:
One more problem I am facing with synchronize local "E:\xxx\yyyy\zzzz\" "/yyyy/zzzz/", command is - Everytime when I execute the command it is trying to copy all the files, Even if the files already exists on the Local.
How can I eleminate this ?

Please read FAQ:
https://winscp.net/eng/docs/faq_synchronize

If that does not help, come back.
_________________
Martin Prikryl
TK

Guest


Hello Prikryl
Thank you for the reply.

I tried scheduling it as a job in Windows scheduler, but it is throwing me the following error
"host does not exist"

Steps to generate the issue
1>Go to Start ->All Programs -> Accessories -> System Tools ->Task Scheduler

2>I went to the Actions tab -> Updated 'Program/script:' with '"C:\Program Files (x86)\WinSCP\WinSCP.exe"'
and 'Add arguments(optional)' As '/script="C:\Program Files (x86)\WinSCP\sync.txt"'

and the general settings are
When Running the task, use the following users account: (I used my own credentials windows network credentials, and my account has full admin permissions.)

Run with highest privileges check box is selected.

The code I have in 'sync.txt' is as follow::

option confirm off
option batch continue
open ftp://xxxx:yyyy@test.com
synchronize local "P:\aaa\bbb\ccc\" "/pppp/qqqq/"
exit

The Operating system in which I tried setting up the job is "Windows 7 Professional"

What is the cause for this error and what is the fix for this issue

Thank you for the support

prikryl wrote:
TK wrote:
a>Will Copy down the latest files from Remote to Local
b>Will Update the changed files to Local
c>Will delete the local files if the they are deleted on Remote?

Correct.

Quote:
One more problem I am facing with synchronize local "E:\xxx\yyyy\zzzz\" "/yyyy/zzzz/", command is - Everytime when I execute the command it is trying to copy all the files, Even if the files already exists on the Local.
How can I eleminate this ?

Please read FAQ:
https://winscp.net/eng/docs/faq_synchronize

If that does not help, come back.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please attach a full log file showing the problem.

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.


Note that I'm pretty sure that this has nothing to do with WinSCP.
_________________
Martin Prikryl
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