Index: unix_installer/upgrader-package/java/backup.java =================================================================== diff -u -rdfde3b7525955235b664ca801fdece4fb418b532 -r93b5a921b65de778d5151605132f85683deb0741 --- unix_installer/upgrader-package/java/backup.java (.../backup.java) (revision dfde3b7525955235b664ca801fdece4fb418b532) +++ unix_installer/upgrader-package/java/backup.java (.../backup.java) (revision 93b5a921b65de778d5151605132f85683deb0741) @@ -7,7 +7,7 @@ private BufferedReader in; - private String backupdir, jbossdir; + private String backupdir, jbossdir, repositoryDir, etcdir; public String mysqldir, dbuser, dbname, dbpass, dburl; @@ -30,6 +30,8 @@ { System.out.println("Copying files from " + jbossdir + "/ to " + backupdir + "/jboss-4.0.2/ ..."); copyFiles(jbossdir + "/", backupdir+"/jboss-4.0.2/"); + copyFiles(etcdir + "/", backupdir+"/ectlams2/"); + copyFiles(repositoryDir + "/", backupdir+"/repository/"); System.out.println("Done.\n"); } catch (IOException e) @@ -52,6 +54,8 @@ Properties lamsProperties = new Properties(); lamsProperties.load(new FileInputStream("lams.properties")); jbossdir = lamsProperties.getProperty("JBOSS_DIR"); + repositoryDir = lamsProperties.getProperty("LAMS_DIR") + "/repository"; + etcdir = "/etc/lams2"; mysqldir = lamsProperties.getProperty("SQL_DIR"); dbname = lamsProperties.getProperty("DB_NAME"); dbuser = lamsProperties.getProperty("DB_USER"); @@ -154,30 +158,29 @@ // The method copyFiles being defined public void copyFiles(String strPath, String dstPath) throws IOException { - - File src = new File(strPath); File dest = new File(dstPath); - if (src.isDirectory()) + if (src.exists()) { - System.out.println("Copying: " + src.getAbsolutePath()); - dest.mkdirs(); - String list[] = src.list(); - - - - for (int i = 0; i < list.length; i++) + if (src.isDirectory()) { - String dest1 = dest.getAbsolutePath() + "/" + list[i]; - String src1 = src.getAbsolutePath() + "/" + list[i]; - copyFiles(src1 , dest1); + System.out.println("Copying: " + src.getAbsolutePath()); + dest.mkdirs(); + String list[] = src.list(); + + for (int i = 0; i < list.length; i++) + { + String dest1 = dest.getAbsolutePath() + "/" + list[i]; + String src1 = src.getAbsolutePath() + "/" + list[i]; + copyFiles(src1 , dest1); + } } + else + { + copy(src, dest); + } } - else - { - copy(src, dest); - } } public void copy(File source, File target) throws IOException Index: unix_installer/upgrader-package/update-lams.sh =================================================================== diff -u -rd3e1423ab32ceafba2ea46b790b7206c6e8dbfad -r93b5a921b65de778d5151605132f85683deb0741 --- unix_installer/upgrader-package/update-lams.sh (.../update-lams.sh) (revision d3e1423ab32ceafba2ea46b790b7206c6e8dbfad) +++ unix_installer/upgrader-package/update-lams.sh (.../update-lams.sh) (revision 93b5a921b65de778d5151605132f85683deb0741) @@ -285,7 +285,8 @@ backup() { printf "\nDo you wish to automatically backup lams before updating? (Recommended. NOTE: Requires MySql to be installed at localhost)\n" - printf "The space required to backup your LAMS installation: \n" + printf "Please check the below directories are correct before running this backup. If they are not, quit the installer and backup LAMS manually.\n" + printf "The space required to backup your LAMS installation:\n" du -chs $LAMS_DIR $JBOSS_DIR printf "(y)es I wish to backup LAMS.\n" printf "(n)o I have already backed up LAMS, I am ready to update.\n" @@ -309,18 +310,18 @@ $JDK_DIR/bin/java -cp bin backup if [ "$?" -ne "0" ] - then - echo "Update failed, please check that LAMS $REQ_LAMS_VERSION is installed and your lams.properties file is correct." - installfailed - fi + then + echo "Update failed, Failed to backup LAMS." + installfailed + fi chmod 755 bin/lamsdump.sql bin/lamsdump.sql if [ "$?" -ne "0" ] - then - echo "Update failed, please check that LAMS $REQ_LAMS_VERSION is installed and your lams.properties file is correct." - installfailed - fi + then + echo "Update failed, problem dumping database for backup." + installfailed + fi ;; n)