View Single Post
  #8 (permalink)  
Old 23-12-2008, 12:19 PM
amanuensis amanuensis is offline
Junior Member
User
 
Join Date: Nov 2008
OS: Debian
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
amanuensis is on a distinguished road
Default Zipping folder within folders

Hi

This may be beyond the capability of a shell script, but I was wondering.
I have a series of folders 50 in total and they reside inside a folder called 'events' inside these folders there are in fact many other files and folders.
Is it possible for a shell script to get hold of all of the folders that reside inside the 'events folder' however deep they are, zip them and put them into the same folder thus keeping the file structure, only change would be the addition of a zip file for all the corresponding folders.

Before:
folder1
folder2
folder3


After
folder1
folder1.zip
folder2
folder2.zip
folder3
folder3.zip

and the same scenario for any other folders inside folder1, folder2 and folder 3.

I suppose I am wanting to see if there is possible to script to select all the folders within one folder (events) without having to name them individually in the script (all folders within the events folder to be zipped and remain in the same location and of course when the script runs again, once a day, for it to replace the old zip with the new one)

Hope all this make sense.

Last edited by amanuensis; 23-12-2008 at 12:23 PM.
Reply With Quote