Differences
This shows you the differences between the selected revisions of the page.
2009-11-21 | 2009-11-21 | ||
normalize code (martin) | auto_compress_download (martin) | ||
Line 359: | Line 359: | ||
* When placed on desktop, you can drop any local directory to it to start synchronization; | * When placed on desktop, you can drop any local directory to it to start synchronization; | ||
* When placed to ''c:\documents and settings\username\sendto'', you can use //Send To > Your Shortcut// from context menu of any local directory. | * When placed to ''c:\documents and settings\username\sendto'', you can use //Send To > Your Shortcut// from context menu of any local directory. | ||
+ | |||
+ | ===== [[auto_compress_download]] Automatically compress files before download ===== | ||
+ | Following script compresses selected files into tar/gzip archive and downloads it: | ||
+ | |||
+ | <code winscp> | ||
+ | option batch abort | ||
+ | option confirm off | ||
+ | open mysession | ||
+ | cd %1% | ||
+ | call tar -czf /tmp/archive.tar.gz %2% | ||
+ | lpwd | ||
+ | get -delete /tmp/archive.tar.gz | ||
+ | exit | ||
+ | </code> | ||
+ | |||
+ | Launch the above script from batch file like the one below: | ||
+ | |||
+ | <code> | ||
+ | winscp.com /script=example.txt /parameter %* | ||
+ | if errorlevel 1 goto error | ||
+ | |||
+ | echo Retrieving files succeeded | ||
+ | gzip -d archive.tar.gz | ||
+ | tar -xf archive.tar | ||
+ | del archive.tar | ||
+ | exit | ||
+ | |||
+ | :error | ||
+ | echo Retrieving files failed | ||
+ | </code> | ||
+ | |||
+ | Example of running the batch file to download all files under ''/home/user/www'': | ||
+ | |||
+ | <code> | ||
+ | example.bat /home/user/www *.* | ||
+ | </code> | ||
+ | |||
+ | The batch file needs Windows ports of ''gzip'' and ''tar'' tools. You can get them from [[http://sourceforge.net/projects/unxutils/|UnxUtils]] project. | ||
<trailer> | <trailer> |