WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> ZIP multiple sub directories within a directory...
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1342085250

Message started by ajais on Jul 12th, 2012 at 11:27am

Title: ZIP multiple sub directories within a directory...
Post by ajais on Jul 12th, 2012 at 11:27am
I am trying to use the ZIP plugin to ZIP entire sub-dirs within a main dir as they are completed (files stop being written in them).  Is this possible?  

For example, I have a directory called D:\WORK.  As images are taken through the night by the main telescope, sets are created and named based on Right Ascension and Declination and images of all the galaxies in that zone are stored in sub-directories named appropriately so for example a directory called D:\WORK\13-14+10+20_071112 would be created and contain image files. Once done a new one like D:\WORK\14-15+10+20_071112 is created with other image files.  I currently have the plugin working creating ZIP files for the directories.  Here is the problem:  the actual zipping of the files does not happen until all of the night's imaging is complete and a QUIET event fires for D:\WORK.  What I would like to do is have each sub-directory of D:\WORK get actually ZIPed once the sub-directory goes quiet. This would allow uploading of images via FTP throughout the night rather than waiting to upload them all in the morning (which is very beneficial for our European scientists who can get the data during daylight hours in Europe).  Can this be done or is a new feature request?

Thanks for your help.

Title: Re: ZIP multiple sub directories within a director
Post by Gert on Jul 12th, 2012 at 11:43am
Hi,

Yes, it can get a little confusing with the ZIP task. Here is how I would do it:

Let the task monitor D:\Work (and subdirectories) for new images. You only need the "new file (FILENEW)" option, you can disable QUIET.
Assuming you want to have the zips in F:\Testing, enter "f:\testing\{parentdir}.zip" as the target directory.
Do NOT set "create ZIPS for complete directories".
DO set the option "Add files to existing ZIP".

The {parentdir} tag you see above is automatically replaced by the name of the directory where the detected file is found.
So the file D:\Work\Directory1\hello.jpg will be added to the zip f:\testing\Directory1.zip.

Is that what you need?

Title: Re: ZIP multiple sub directories within a director
Post by ajais on Jul 12th, 2012 at 5:25pm
Thanks Gert! That looks like what I want. I will give it a try.

Title: Re: ZIP multiple sub directories within a director
Post by ajais on Jul 12th, 2012 at 7:01pm
It works!  Thanks Gert!!

Title: Re: ZIP multiple sub directories within a director
Post by Gert on Jul 12th, 2012 at 7:11pm
Great.

Remember you can use a lot of other tags and directories will be auto-created if they are missing. For example:

F:\Testing\{year}\{month}\{day}\{parentdir}.zip
To get something like
F:\Testing\2012\07\12\Directory1.zip
or
F:\Testing\{parentdir}{extension}.zip
which will put all filetypes (jpg, png, ...) in their own zip.

Using {tags} is called "dynamic naming" and it offers a lot of possibilities.

See http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html

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