amanuensis 0 Newbie Poster

Try a php piece of software called secureloads - only problem is it won't download a large number of large files - take a look, interested in your opinion - i have it running but it onlt works on small file, maybe you can amend tehe problem

amanuensis 0 Newbie Poster

It keeps freezing and gives an error something like Kernel Trap followed by gibberish numbers. This is just lately. WTF is wrong with it ?

Try and use another machine to boot up the mac with the fault, connect them both via firewire and turn on the poorly mac while holding the 'T' key down, keep holding it down till the Firewire symbol comes on the screen. boot up your good mac and you should in theory have the poorly mac mounted as an external HD on your desktop, run disk utility through it as a start - after it has repaired the poorly mac boot up on it as normal. If that does not work let me know how it went.

amanuensis 0 Newbie Poster

Hi Mike

Just checking that you got the PM I sent through to you?

amanuensis 0 Newbie Poster

Hi Mike

From the terminal I did a find with
find /domains/•/•/••••••••••t.com/public_html/storage/events/
and it came back with a read out of everything contained in the events folder and of course their paths, as there are 50 folders I won't paste the results

amanuensis 0 Newbie Poster

Hi Mike

The scripts below both gave this output: (bold is were I made the changes)

+ EVENTDIR=/domains/•/•/••••••••••.com/public_html/storage/events/
+ DELETE_OLD_ZIP_FILES=yes
+ ZIP=/usr/bin/zip
+ PID=19150
++ date +%m%d%y
+ DATE=011909
+ TMP=01190919150
+ find /domains/•/•/••••••••••.com/public_html/storage/events/ -type d -name 'events[0-9]*'
+ read x




#!/bin/bash -x

# Top level directory to look for event* sub-folders
EVENTDIR="/domains/•/•/••••••••••.com/public_html/storage/events/"

# Set to "no" keep old zip file and add new file
DELETE_OLD_ZIP_FILES="yes"

# Path to zip executable
ZIP=/usr/bin/zip

# Unique $TMP extension for newly created zip files
# Temp extensions made up of PID of running process and
# date.  Ex from 1/11/09 with PID 23454: 01110923454
PID=$$
DATE=`date +%m%d%y`
TMP=${DATE}${PID}

# Find all events subdirs in main events dir - events1, events2, etc
# -name = events[0-9]* rather than events* to make sure the main events folder doesn't get added
**find /domains/•/•/••••••••••.com/public_html/storage/events/ -type d -name "events[0-9]*"|while read x**
do
        # Then create a zip with contents of each and the name of the
        # events folder with tmp extension appended.  Ex: events1.zip.01109.23454
        zip -r ${x}.zip.${TMP} ${x}
        if [ $DELETE_OLD_ZIP_FILES == "yes" ]
        then
                # If our variable says to delete old zip files, move the temporary
                # zip file to the straight name - e.g. events1.zip
                mv ${x}.zip.${TMP} ${x}.zip
                # Then, just to be sure, remove all possible temporary zip files
                # left over from previous saves
                rm -f ${x}.zip.*
        else
                # If our variable says to NOT delete the old zip files,
                # if the zip file exists...
                if [ -e  ${x}.zip ] …
amanuensis 0 Newbie Poster

Hi mike

Sorry for sounding so dumb but are you wanting me to replace the whole line from:
find $EVENTDIR -type d -name "events[0-9]*"|while read x
to
find /domains/*/*/*************.com/public_html/storage/events/

amanuensis 0 Newbie Poster

Hi Mike

Triggered the script off from the Terminal and got the read out below:

+ EVENTDIR=/domains/*/*/*************.com/public_html/storage/events/
+ DELETE_OLD_ZIP_FILES=yes
+ ZIP=/usr/bin/zip
+ PID=24493
++ date +%m%d%y
+ DATE=011609
+ TMP=01160924493
+ find /domains/*/*/*************.com/public_html/storage/events/ -type d -name 'events[0-9]*'
+ read x

Ubuntu 6.06 LTS is the Linux version I am running.

And I am running it from root.

amanuensis 0 Newbie Poster

Hi Mike
Just checked the script and the double quotes are in place, (script is below), can't find a way to edit my previous post wherever I look. I did re-enter the double quotes thinking that may have done something but to no avail, the read out in OUTPUT is the same as previous.

#!/bin/bash -x


# Top level directory to look for event* sub-folders
EVENTDIR="/domains/*/*/**************.com/public_html/storage/events/"


# Set to "no" keep old zip file and add new file
DELETE_OLD_ZIP_FILES="yes"


# Path to zip executable
ZIP=/usr/bin/zip


# Unique $TMP extension for newly created zip files
# Temp extensions made up of PID of running process and
# date.  Ex from 1/11/09 with PID 23454: 01110923454
PID=$$
DATE=`date +%m%d%y`
TMP=${DATE}${PID}


# Find all events subdirs in main events dir - events1, events2, etc
# -name = events[0-9]* rather than events* to make sure the main events folder doesn't get added
find $EVENTDIR -type d -name "events[0-9]*"|while read x
do
# Then create a zip with contents of each and the name of the
# events folder with tmp extension appended.  Ex: events1.zip.01109.23454
$ZIP -r ${x}.zip.${TMP} ${x}
if [ $DELETE_OLD_ZIP_FILES == "yes" ]
then
# If our variable says to delete old zip files, move the temporary
# zip file to the straight name - e.g. events1.zip
mv ${x}.zip.${TMP} ${x}.zip
# Then, just to be sure, remove all possible temporary zip files
# left over from previous saves
rm -f ${x}.zip.*
else
# If our variable says to NOT delete the …
amanuensis 0 Newbie Poster

Hi Mike

Got this from the OUTPUT file after implementing your previous instruction. I have put the •'s in

+ EVENTDIR=/domains/•/•/••••••••••••••••••.com/public_html/storage/events/
+ DELETE_OLD_ZIP_FILES=yes
+ ZIP=/usr/bin/zip
+ PID=3587
++ date +%m%d%y
+ DATE=011509
+ TMP=0115093587
+ find /domains/c/a/catalystglobal-vault.com/public_html/storage/events/ -type d -name 'events[0-9]*'
+ read x

amanuensis 0 Newbie Poster

Hi Mike
Made the recommended changes and opened the log file in temp named 'OUTPUT' and the file is blank, nothing recorded in it.

amanuensis 0 Newbie Poster

Hi Mike

I have installed the script and ensured that the path has been entered correctly, when the script was triggered by the cron, it seemed to start then stop. Upon checking the Events folder nothing had changed - any ideas?

amanuensis 0 Newbie Poster

Hi Mike

Is there any chance of you putting the whole script together and putting comments through the script explaining what parts do what - I am very keen to learn but am still at a very early stage - I do realise that this is taking your time and can only repeat a big thank you for all the help you have given me so far - is there a book you could recommend for learning shell scripting (basic), hope you are not offended by my requests.

Many thanks

/domains/*/*/*************.com/public_html/storage/events

above is the path to events - I will fill in the asterix's

amanuensis 0 Newbie Poster

Hi thanks again
Where would you recommend that I insert your suggested code?
Should it be replacing any of the existing code I have in place?

amanuensis 0 Newbie Poster

First of all many thanks for your reply.
Yes you are close.
I will attempt to give you the full picture.
I have a php script running on a dedicated server (Securloads is the script).
It is a really good script, ideal for what I am trying to achieve, it allows me to give access to clients to download via a browser any combination of files and folders that I allocate them permissions for, the access is username and password protected.
If I give you access to 'Folder1', and 'Folder2' inside The 'EVENTS FOLDER thus all its contents within 'Folder1' and 'Folder2', all I do at the back end is allocate you the permission to do so, then you will have access to download only those folders and what they contain, despite the fact that there may be many other folders in the 'EVENTS' folder, when you log in 'Folder1 and Folder2 are all you will see. How the script goes about downloading individual files inside those folders is clean and simple, you check/tick the file you require (checkbox at the side of every file) and at the otherside of the name of every file/s there is also a button for you to download - my problem is that when I require a folder to be downloaded s opposed to a file, when the folder has been selected and the download button is pressed the contents of that folder are then zipped before downloading and …

amanuensis 0 Newbie Poster

I have a folder on my server named 'EVENTS' and it contains an additional 50 folders 'EVENT1', 'EVENT2', 'EVENTS3' etc, etc. Each of these 50 folders contains within them a varying amount of files and folders also. (So that is the set up).
I am wondering if it is within the capabilities of a script to zip all folders in the 'EVENTS' folder recursively ('EVENT1', EVENT2 etc) which would of course include all of the folders contained inside the 50 that live in 'EVENTS' folders. Kind of drilling through all folders contained within the 'EVENTS' folder without having to name them all in the script as they will be changing over time.
If this could be done (I would need a cron to run it once a day) I would need the old zip to be deleted by the new daily zip.
At all times I would have the folder structure mentioned above in place with a zipped version of every folder next to the actual folder it was a zipped version of.

So if I was speaking to the script I would say " I want you to go into every folder you find inside the 'events' folder and zip it, but you must leave the original folders that you have zipped in place and drop the zipped version of next to it, I want you then to do this every day and remove the old zip with the new one, I don't have a …