Answer to Backup with cmsshell.sh (Re: [opencms-dev] Who has worked with CmsShell ?)

Sven Dittmar dittmar at rus.uni-stuttgart.de
Fri Apr 4 08:35:43 CEST 2003


Hi all,

for the record and for "wilma" :-)

> Question: How can I run a cronjob to shutdown the opencms-app, start the 
> cmsshell with a batch-file and then restart the opencms-app in order to 
> create a nightly export?
Nobody had an answer.

I have one now. It's a quick&dirty-solution and I don't like the 
wget-part but it works well.

We run a nightly cronjob (while that is running, OpenCMS is not avaiable 
for the users!) on a linux-box and OC5RC2.

Four steps are required:

# Step a) [ Stop the opencms-webapp, you also need a .wgetrc for that ]
/usr/bin/wget http://host:8080/manager/html/stop?path=/opencms5rc2

# Step b) [ go to WEB-INF directory, start cmsshell.sh with parameter file ]
cd webapps/opencms5rc2/WEB-INF/
j2sdk1.4.1_01/jre/bin/java -Dfile.encoding=ISO-8859-1 
-Dopencms.disableScheduler=true  -classpath 
../../../common/lib/servlet.jar:lib/opencms.jar:lib/activation.jar:lib/jakarta-oro-2_0_6.jar:lib/mysql-connector-java-2_0_14-bin.jar:lib/Tidy.jar:lib/mail.jar:lib/fesi.jar:lib/xerces-1_4_4.jar 
com.opencms.boot.CmsMain "$@" < webapps/opencms5rc2/WEB-INF/cmdlist.txt

# Step c) [ move ZIP-file ]
mv webapps/opencms5rc2/WEB-INF/all.zip 
webapps/opencms5rc2/WEB-INF/opencms-export`date +%Y%M%d%H%M`.zip

# Step d) [ start webapp again ]
/usr/bin/wget http://hostname:8080/manager/html/start?path=/opencms5rc2


cmdlist.txt just contains:
   login admin "secretadminpassword"
   exportAllResources all
   exit

Have a nice weekend all,
Sven




More information about the opencms-dev mailing list