Topic "Automatic compression before downloading"

Author Message
[View user's profile]

Joined: 2016-09-02
Posts: 1
Location: Australia
Hey all,

I'm trying to implement automated website backups from FTP.
For now, my script successfully downloads files and puts them in my local dir:

option batch on
option confirm off
open session
option transfer binary
get /* "path\%TIMESTAMP#(\*"
synchronize local "local\path\%TIMESTAMP#(" /

But I also want to have a zipped file instead of a folder as the result.
I am not a programmer so it's kind of hard for me to figure out how to integrate the "Automatically compress files before download" snippet from this website to my script.

I've been trying to play around with it but, unsurprisingly, it doesn't work:


open session
call tar -czf /tmp/archive.tar.gz /
get /tmp/archive.tar.gz "local\path\%TIMESTAMP#(\*"

Could someone please point me in the right direction. Help would be much appreciated.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24757
Location: Prague, Czechia
Your script looks correct in general.

But it will work with SFTP or SCP protocol only. If you are really using the FTP, you generally cannot execute commands on the server.

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License