Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

Re: Script exits prematurely with no errors

If you want the "synchronize" to delete files, you need to add -delete switch.
ishmell

Script exits prematurely with no errors

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@192.168.1.12:22 -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
exit

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?