Topic "How to compress a directory with WinSCP using SCP protocol"

Author Message
[View user's profile]

Joined: 2004-03-26
Posts: 4
Location: Tallahassee, FL
Here is the command I wrote to tar and gzip a directory. It does not delete the original directory. It prompts the user for the archive name, an exclusion pattern (can be blank) and a directory or filename to compress. You must be using SCP protocol for custom shell commands as SFTP doesn't allow it. You can add this as a custom command:

Description: Compress Directory

tar -czvf "!?&Enter an Archive Name:?archive.tgz!" --exclude="!?&Exclude files matching pattern:?*.exe!" "!?&Specify directory or file to compress:?!"
Nowhere does science promise emancipation.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
Thanks for your contribution. I'll add the command to the default custom commands.
Martin Prikryl

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