rsync configureable
authoridfx <idfx>
Sun, 16 Sep 2001 16:25:57 +0000 (16:25 +0000)
committeridfx <idfx>
Sun, 16 Sep 2001 16:25:57 +0000 (16:25 +0000)
source/config.properties-dist
source/mir/misc/Helper.java
source/mircoders/servlet/ServletModuleOpenIndy.java

index c3b1ad0..16dea49 100755 (executable)
@@ -7,6 +7,11 @@ HTMLTemplateProcessor.DocRoot=/idfx
 
 ClearXslCache=no
 DirectOpenposting=yes
+
+#use rsync to mirror the website to a remote-host
+Rsync=no
+Rsync.Script.Path=/var/www/bin/rsync-copy
+
 StandardLanguage=de
 
 # the directory where the html-files will be saved
@@ -243,4 +248,4 @@ Xsl.TopicList=producer/topic.xsl
 Xsl.OpenList=producer/open.xsl
 Xsl.Wap=producer/wml2.xsl
 
-Sync.Script.Path=/var/www/bin/rsync-copy
+
index bbfb842..0dad690 100755 (executable)
@@ -17,13 +17,18 @@ public class Helper {
    * rsync the webrepository
    * needs a rsyncscript
    * returns the exit-code
+        * returns 255 if rsync should not be used
    */
   public static int rsync(){
-    Process p;
+               if(!Configuration.getProperty("Rsync").toLowerCase().equals("yes")){
+                       return 255;
+               }
+               
+         Process p;
     int returnValue = -1;
     try {
       Runtime run = Runtime.getRuntime();
-      p = run.exec(Configuration.getProperty("Sync.Script.Path"));
+      p = run.exec(Configuration.getProperty("Rsync.Script.Path"));
       returnValue = p.waitFor();
     } catch (IOException e) {
       return returnValue;
@@ -32,4 +37,4 @@ public class Helper {
     }
     return returnValue;
   }
-}
\ No newline at end of file
+}
index 3c218d5..8bec930 100755 (executable)
@@ -103,6 +103,7 @@ public class ServletModuleOpenIndy extends ServletModule
 
         // sync the server
         int exitValue = Helper.rsync();
+                               theLog.printDebugInfo("rsync:"+exitValue);
 
         // redirecting to url
         // should implement back to article
@@ -234,6 +235,7 @@ public class ServletModuleOpenIndy extends ServletModule
       // sync the server
       //should be configureable
       int exitValue = Helper.rsync();
+                       theLog.printDebugInfo("rsync: "+exitValue);
 
     }
     catch (IOException e) { throw new ServletModuleException(e.toString());}