Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Last active December 11, 2015 02:28
Show Gist options
  • Save ecarreras/4530331 to your computer and use it in GitHub Desktop.
Save ecarreras/4530331 to your computer and use it in GitHub Desktop.
Scripts per actualització de versió de l'ERP
#!/bin/sh
source VARS.sh
for DBNAME in `psql -ltA | grep '|erp|' | cut -d '|' -f 1`; do
echo "Dumping $DBNAME" && \
mkdir -p /home/erp/var/backups/${DBNAME} && \
pg_dump $DBNAME > "/home/erp/var/backups/${DBNAME}/${DBNAME}_pre_${VERSION}.sql" && \
echo "$DBNAME backup done." &
done
#!/bin/sh
source VARS.sh
for DBNAME in `psql -ltA | grep '|erp|' | cut -d '|' -f 1`; do
echo "Bziping $DBNAME" && \
bzip2 "/home/erp/var/backups/${DBNAME}/${DBNAME}_pre_${VERSION}.sql" && \
echo "$DBNAME backup done." &
done
#!/bin/sh
for DBNAME in `psql -ltA | grep '|erp|' | cut -d '|' -f 1`; do
echo "Executing in $DBNAME" && \
psql $DBNAME < $1 && \
echo "$DBNAME done."
done
source /home/supervisor/bin/activate
supervisorctl restart `supervisorctl status | grep 'ERP_' | cut -d ' ' -f 1 | xargs `
#!/bin/sh
cd /home/erp/src/erp/server/bin
for SCONF in `ls -1 /home/erp/conf | grep -v mongo`; do
echo "Updating $SCONF..." && \
./openerp-server.py --config=/home/erp/conf/$SCONF --price_accuracy=6 --update=all --stop-after-init && \
echo "******* $SCONF Done ********" &
done
VERSION="2.35.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment