Topic "Script exits prematurely with no errors"

Author Message
[View user's profile]

Joined: 2011-12-19
Posts: 1
Location: seattle, wa
I am trying to ensure a local folder is synced up with my web server. I use it as a backup mechanism and do not mod files in the local folder, I just want to ensure that the local folder represents the contents of the web server after each sync.

Remote web server:
CentOS 5.7

Local system:
Windows Server 2003 R2 32bit
WinSCP v4.3.5.1463 (also tried older versions with same result)
Scripting used to sync local and remote web server
Transfer Protocol: SFTP (SCP)

The script:
option batch continue
option echo off
option confirm off
open backup:xxxxxxx@ -timeout=300 -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
call rm -f /tmp/all_databases.sql
call mysqldump -h localhost --user xxxxx --password=xxxxxxxx --all-databases > /tmp/all_databases.sql
call gzip -c /tmp/all_databases.sql > /tmp/all_databases.gz
call rm /tmp/all_databases.sql
get -delete /tmp/all_databases.gz Z:\web1\all_databases.gz
synchronize local Z:\web1\www /var/www -criteria=time

I can't see any obvious cause for the script exiting prematurely. It runs through collection of sync data, then starts syncing files, then simply exits with no error to show why. The file list on the local system does not match the file list on the remote web server to the tune of 20k+ files that exist locally but do not exist on the remote web server (i.e. I deleted them on the web server and I want them gone locally too). Of course I could remove them from the local machine manually, but that's the job of the sync command and it's not performing. I've run the script multiple times and every time I get the same result. Any ideas? (788.54 KB) [Download]

Description: contains log file and screenshot.

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
If you want the "synchronize" to delete files, you need to add -delete switch.
Martin Prikryl

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License