1
0
forked from ScoDoc/ScoDoc

exporte config poursuites etudes

This commit is contained in:
IDK 2021-08-18 18:46:54 +02:00
parent 48d5995a2a
commit 4a834d748f

View File

@ -48,7 +48,7 @@ for cfgfile in "$INSTANCE_DIR"/var/scodoc/config/depts/*cfg USERS
do do
cfgfile=$(basename "$cfgfile") cfgfile=$(basename "$cfgfile")
dept="${cfgfile%*.cfg}" dept="${cfgfile%*.cfg}"
db_name="SCO$dept" db_name=$(echo "SCO$dept" | tr "[:lower:]" "[:upper:]")
echo "$db_name" echo "$db_name"
su -c "pg_dump --format=custom --file=\"$DEST/$db_name.dump\" \"$db_name\"" postgres su -c "pg_dump --format=custom --file=\"$DEST/$db_name.dump\" \"$db_name\"" postgres
if [ ! "$?" -eq 0 ] if [ ! "$?" -eq 0 ]
@ -63,28 +63,13 @@ chown root "$DEST"
echo "Copying var/ ..." echo "Copying var/ ..."
cp -rp "$INSTANCE_DIR/var" "$DEST" cp -rp "$INSTANCE_DIR/var" "$DEST"
# Depts db config (now in .../var)
shopt -s nullglob
if [ -n "$(echo ${SCODOC_DIR}/config/depts/*.cfg)" ]
then
echo "Copying legacy depts configs..."
cp -rp "$SCODOC_DIR/config/depts" "$DEST"
fi
# Photos des etudiants (now in .../var)
if [ -e "$SCODOC_DIR/static/photos" ]
then
echo "Copying legacy photos..."
cp -rp "$SCODOC_DIR/static/photos" "$DEST"
fi
echo "Copying logos..." echo "Copying logos..."
cp -rp "$SCODOC_DIR/logos" "$DEST" cp -rp "$SCODOC_DIR/logos" "$DEST"
echo "Copying configuration file..." echo "Copying configuration file..."
cp -p "$SCODOC_DIR/config/scodoc_config.py" "$DEST" mkdir "$DEST/config"
cp -p "$SCODOC_DIR/config/scodoc_config.py" "$DEST/config/"
cp -rp "$SCODOC_DIR/config/doc_poursuites_etudes" "$DEST/config/"
echo "Copying server logs..." echo "Copying server logs..."
cp -rp "$INSTANCE_DIR/log" "$DEST" cp -rp "$INSTANCE_DIR/log" "$DEST"