Greetings!
I have tested this with ZEO 1.0b4
So I will assume it will also work for those running standalone Zope Servers.
This How-To is taken from my other How-To: How-To: Automatically compress Data.fs using cron
Purpose
To automatically export folders using cron.
- Backup previous exported file if it exists.
- Export specified folder
- Check for file existence.
Assumptions
Your server is secured/ hardened. We don't want anyone else controlling cron.
You know a little linux shell scripting.
Procedure
Step 1
For better security:
Create a new file: auth.conf
This will contain your authentication information.
This is so that we can isolate the auth info from the script.
You can optionally put this auth.conf and your compression script in a separate folder.
This is just for ease of use.
Sample auth.conf
ZOPE_AUTH=username:password
That's it! Just one line.
Like I said, this is just to isolate the authentication info from the script.
Step 2
Then here comes the script that will do all the work for you. grins
Note: Some lines are quite long thus, they wrap along the sides.
Just make sure you get them correctly.
FILE_NAME - The Zope folder you want to backup. ZOPE_PATH - Where Zope resides. JOBS_PATH - This is optional. Where you will place your compression script and auth.conf file. STAMP - This is the time stamp that will be used in the backup file.
Current setup:
%b - locale's abbreviated month name (Jan..Dec) %d - day of month (01..31) %Y - year (1970...) ZOPE_COMMAND - This is the command for accessing Zope ZOPE_ADDRESS - This is your server location. Perhaps you can use "http://localhost:port". I didn't test it though.
This is a simple script that will export the Zope folder then back it up.
This will give you a previous backup that you can revert to in case you need to.
Acknowledgements
Steve Spicklemire ([email protected])
- For sharing his time and sample scripts. Bakhtiar A. Hamid ([email protected])
- For sharing his own script.