[Scodoc-devel] [SVN] Scolar : [1267] Enhanced data migration script

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Mer 2 Oct 12:21:27 CEST 2013


Une pièce jointe HTML a été nettoyée...
URL: <https://www-rt.iutv.univ-paris13.fr/pipermail/scodoc-devel/attachments/20131002/9b4b60ba/attachment.html>
-------------- section suivante --------------
Modified: branches/ScoDoc7/config/install_debian7.sh
===================================================================
--- branches/ScoDoc7/config/install_debian7.sh	2013-10-01 21:00:10 UTC (rev 1266)
+++ branches/ScoDoc7/config/install_debian7.sh	2013-10-02 10:21:27 UTC (rev 1267)
@@ -27,8 +27,11 @@
    exit 1
 fi
 
+# ------------ Permissions
+# source dir should be writable by scodoc to write bytecode files
+chgrp www-data $SCODOC_DIR $SCODOC_DIR/ZopeProducts/*
+chmod g+w $SCODOC_DIR $SCODOC_DIR/ZopeProducts/*
 
-
 # ------------ LOCALES
 echo 
 echo '---- Configuration des locales...'

Modified: branches/ScoDoc7/config/restore_scodoc_data.sh
===================================================================
--- branches/ScoDoc7/config/restore_scodoc_data.sh	2013-10-01 21:00:10 UTC (rev 1266)
+++ branches/ScoDoc7/config/restore_scodoc_data.sh	2013-10-02 10:21:27 UTC (rev 1267)
@@ -10,7 +10,7 @@
 #
 
 
-INSTANCE_DIR=/opt/scodoc/instance
+INSTANCE_DIR=/opt/scodoc/
 SCODOC_DIR="$INSTANCE_DIR/Products/ScoDoc"
 
 source utils.sh
@@ -51,6 +51,13 @@
   cd "$tmp"
   tar xfz "$SRC" 
   SRC=$(ls -1d "$tmp"/*)
+  IS_TMP=1
+  # If source is a tgz, can use mv
+  COPY="mv"
+else
+  IS_TMP=0
+  # If source is a directory, does not modify its content
+  COPY="cp -rp"
 fi
 
 echo "Source is $SRC"
@@ -67,23 +74,29 @@
 # 
 echo Copying data files...
 rm -rf "$SCODOC_DIR/config/depts" 
-cp -rp "$SRC/depts" "$SCODOC_DIR/config/depts"
+$COPY "$SRC/depts" "$SCODOC_DIR/config/depts"
 
 rm -rf "$INSTANCE_DIR/var"
-cp -rp "$SRC/var" "$INSTANCE_DIR"
+$COPY "$SRC/var" "$INSTANCE_DIR"
 
 rm -rf  "$SCODOC_DIR/static/photos" 
-cp -rp "$SRC/photos" "$SCODOC_DIR/static/" 
+$COPY "$SRC/photos" "$SCODOC_DIR/static/" 
 
 rm -rf "$SCODOC_DIR/logos"
-cp -rp "$SRC/logos" "$SCODOC_DIR/"
+$COPY "$SRC/logos" "$SCODOC_DIR/"
 
 mv "$SCODOC_DIR/config/scodoc_config.py"  "$SCODOC_DIR/config/scodoc_config.py.bak" 
-cp -p "$SRC/scodoc_config.py" "$SCODOC_DIR/config/"
+$COPY "$SRC/scodoc_config.py" "$SCODOC_DIR/config/"
 
 rm -rf "$INSTANCE_DIR/log"
-cp -rp "$SRC/log" "$INSTANCE_DIR/"
+$COPY "$SRC/log" "$INSTANCE_DIR/"
 
+# Remove tmp directory
+if [ $IS_TMP = "1" ]
+then
+  cd /
+  rm -rf $tmp
+fi
 #
 echo
 echo "Ok. Run \"/etc/init.d/scodoc start\" to start ScoDoc."


Plus d'informations sur la liste de diffusion Scodoc-devel