Difference between revisions of "SUNScholar/Rebuild DSpace"

From Libopedia
Jump to navigation Jump to search
Line 10: Line 10:
 
Copy and paste the following into the open nano editor.
 
Copy and paste the following into the open nano editor.
 
<pre>
 
<pre>
#!/bin/bash
+
sudo echo "Waiting 10 seconds for Apache connections to terminate."
clear
+
sleep 10
echo "Please wait."
+
sudo /etc/init.d/tomcat6 stop
 +
echo "Cleaning out old xmlui cache"
 +
sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data
 +
echo "Start package"
 
cd /home/dspace/dspace-1.6.2-src-release
 
cd /home/dspace/dspace-1.6.2-src-release
mvn package
+
mvn package -U clean package
 
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
 
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
 +
echo "Start Ant"
 
ant -Doverwrite=true update clean_backups
 
ant -Doverwrite=true update clean_backups
sudo /etc/init.d/tomcat6 restart
+
echo  "Fix permissions"
sleep 2
+
sudo /root/scripts/fix-permissions
clear
+
echo "Archive catalina log file"
echo "********************************************************************************************************************"
+
tar czvf /var/log/tomcat6/catalina.out-`date +%U`.gz /var/log/tomcat6/catalina.out
echo "Please redeploy as needed when presentation changes have been made if any interface has been made the Tomcat ROOT."
+
rm /var/log/tomcat6/catalina.out
echo "********************************************************************************************************************"
+
sudo /etc/init.d/tomcat6 start
 +
echo "Waiting 10 seconds for Tomcat server to settle."
 +
sleep 10
 +
sudo /etc/init.d/apache2 start
 
</pre>
 
</pre>
 
Replace '''dspace-1.6.2''' with '''dspace-1.6.0''' for DSpace version 1.6.0.
 
Replace '''dspace-1.6.2''' with '''dspace-1.6.0''' for DSpace version 1.6.0.

Revision as of 13:58, 6 June 2011

Log into your server and type the following:

su - dspace
mkdir /home/dspace/scripts
nano /home/dspace/scripts/build-webapps

Tip: It is always a good idea to maximise the open nano window so that the copy and paste of long lines does not wrap around.

Copy and paste the following into the open nano editor.

sudo echo "Waiting 10 seconds for Apache connections to terminate."
sleep 10
sudo /etc/init.d/tomcat6 stop
echo "Cleaning out old xmlui cache"
sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data
echo "Start package"
cd /home/dspace/dspace-1.6.2-src-release
mvn package -U clean package
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
echo "Start Ant"
ant -Doverwrite=true update clean_backups
echo  "Fix permissions"
sudo /root/scripts/fix-permissions
echo "Archive catalina log file"
tar czvf /var/log/tomcat6/catalina.out-`date +%U`.gz /var/log/tomcat6/catalina.out
rm /var/log/tomcat6/catalina.out
sudo /etc/init.d/tomcat6 start
echo "Waiting 10 seconds for Tomcat server to settle."
sleep 10
sudo /etc/init.d/apache2 start

Replace dspace-1.6.2 with dspace-1.6.0 for DSpace version 1.6.0.

Press CTL+O and CTL+X to save the file and exit nano.

Type the following:

chmod 0755 /home/dspace/scripts/build-webapps

Now you can rebuild Dspace by typing the following at anytime.

/home/dspace/scripts/build-webapps