Topic "How to use custom command to zip a folder?"

Author Message
Akari

Guest


I know how to zip a file with
zip -r "!?&File(&A):?archive.zip!" !&
and i know how to zip a folder with
zip -r "!?File(&A):?archive.zip!" !& "!?Folder(&A):?folder name!" !&
But is there a way to zip a select folder without typing any archive name or folder name?
e.g if i selected folder name abc once i rune the command it will create a zip file name abc.zip
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I do not understand your "ZIP folder" command. It seems wrong.

Anyway to ZIP selected folder, use zip -r "!.zip" "!". This way you cannot pack more folders into one archive.
Akari

Guest


Not working for me,
Is there anything require by the server?
But i tried
Code:
 zip -r "a!.zip" "!/"
in folder /WWW/abc/
and i selected 123 folder, the output is zip the /WWW/abc/ in a.zip file.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Akari wrote:
Not working for me

That's not very helpful statement. What does it do? Any error message?
Did you check the Apply to directories option?
_________________
Martin Prikryl
Akari

Guest


Thank you,prikryl!

I just notice i din't check the box "Apply to directories",
after check it, the command is working!! That y alot of command dint run for me..
Sorry my bad english, and thank for your patient to solve my problem. You help me alot, thank again!
higgins
[View user's profile]

Joined: 2014-10-10
Posts: 2
The gzip command won't recursively clamp a catalog into a solitary compress record, when utilizing the -r switch. Rather it will walk that registry structure and compress each one document that it finds into a different record.
MGM

Guest


martin wrote:
I do not understand your "ZIP folder" command. It seems wrong.

Anyway to ZIP selected folder, use zip -r "!.zip" "!". This way you cannot pack more folders into one archive.


How to add timestamp to zip archive?

Like: folder ==> zip into ==> folder-timestamp.zip
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
zip -r "!-`date +%Y%m%d%H%M`.zip" "!/"
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License