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

Zorg

On-fly compressing put and synchronizing files?

Hello
Is there any method for on-fly compressing "synchronizing" and "put" files during commandline script execution?

My BAT file:

@echo off
rem settings for SSH connection and export files
SET WINSCP=winscp.exe
SET SSH=user:password@host
rem work directory
SET DIR_EXPORT=c:\temp\
SET DIR_IMPORT_TEMP=/tmp
rem Copy database dump, prices and logo to outer server
%WINSCP% /console /script=script.txt /log=script.log %SSH%
rem if not %errorlevel%==0 goto err
echo Export success.
goto eof
:err
echo Export failed!!!
:eof



My SCRIPT file

# Automatically answer all prompts negatively not to stall the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Change remote directory
cd %DIR_IMPORT_TEMP%
# Force binary mode transfer
option transfer binary
# Upload the file to current working directory
put %DUMP_EXPORT%
# Synchronize prices and logos
synchronize remote -permissions=666 -delete %PRICE_EXPORT% %PRICE_IMPORT%
# Call shell script for importing sql dump
call %DIR_IMPORT_TEMP%/indbiz_import.cmd
# Disconnect
close
# Exit WinSCP
exit