WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Zip Folders with folder name as Zip file name
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1390970873

Message started by jimaus on Jan 29th, 2014 at 5:47am

Title: Zip Folders with folder name as Zip file name
Post by jimaus on Jan 29th, 2014 at 5:47am
Hi Gert,
I am trying to create zip files of complete folders including sub folders and contents.

I have tried using the Zip plugin as well as 7Zip but I can't quite get the syntax right.

I want to monitor a folder structure e.g.

AdArchive\Newspaper\2014-01-30\Publication\CustomerName\FolderWithStuffInIt\_Links

The monitor will be at AdArchive and look at the subfolders.
The files could be anything and any name, one consistency is an xml file at the "FolderWithStuffInIt" level.
I can look for this file and launch 7Zip, but I would like to name the Zip file as the "FolderWithStuffInIt.zip", this folder name can be anything, but will be the folder containing the xml file.

The bottom level, _Links folder is also consistent, but I do not want it to create its own zip file but be included in the  "FolderWithStuffInIt.zip" file
I have tried all sorts of settings, but cannot get it right.
If I run 7Zip from the command line with a -r switches, it will create 1 zip file of the name of the folder.

Any suggestions would be greatly appreciated?
Cheers, Jim

Title: Re: Zip Folders with folder name as Zip file name
Post by Gert on Jan 29th, 2014 at 6:14am
Hello Jim,

Not much time today, but have a look at this blog:
http://blog-en.gdpsoftware.com/2013/06/free-program-parse-filename-into.html

If you write a little script, it should be easy to launch it wit "run a bat file" and give the resulting zip a proper name.

Gert

Title: Re: Zip Folders with folder name as Zip file name
Post by jimaus on Feb 10th, 2014 at 5:49am
Hi Gert,
Thanks for the link, the issue got too complex, so I decided to move the files in their original folders and not zip them.
It was not worth the complexity.
Thanks, Jim.

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.