Last active
December 11, 2015 02:28
-
-
Save ecarreras/4530331 to your computer and use it in GitHub Desktop.
Scripts per actualització de versió de l'ERP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /home/supervisor/bin/activate | |
supervisorctl restart `supervisorctl status | grep 'ERP_' | cut -d ' ' -f 1 | xargs ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION="2.35.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment