diff --git a/pulldjango.sh b/pulldjango.sh index 92fb1df..8341939 100755 --- a/pulldjango.sh +++ b/pulldjango.sh @@ -1,9 +1,16 @@ #!/usr/bin/zsh -wget -P /home/kthoden/static/eoa --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9005 -wget -P /home/kthoden/static/eos --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9010 -python3 /home/kthoden/src/eoa_makestatic/makestatic.py /home/kthoden/static/eos/eoa2-production.mpiwg-berlin.mpg.de:9010 -wget -P /home/kthoden/static/mprl --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9015 -python3 /home/kthoden/src/eoa_makestatic/makestatic.py /home/kthoden/static/mprl/eoa2-production.mpiwg-berlin.mpg.de:9015 +EOA_STATIC_DIR=/home/eoauser/static +MAKE_STATIC_PY=/home/eoauser/src/eoa_makestatic/makestatic.py +EOA_SRC_DIR=/home/eoauser/src + +rm -rf $EOA_STATIC_DIR/eoa/* +rm -rf $EOA_STATIC_DIR/eos/* +rm -rf $EOA_STATIC_DIR/mprl/* + +wget -P $EOA_STATIC_DIR/eoa --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9005 +wget -P $EOA_STATIC_DIR/eos --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9010 +wget -P $EOA_STATIC_DIR/mprl --mirror --convert-links --adjust-extension --page-requisites --no-parent http://eoa2-production.mpiwg-berlin.mpg.de:9015 +python3 $EOA_SRC_DIR/eoa_makestatic/makestatic.py $EOA_STATIC_DIR/mprl/eoa2-production.mpiwg-berlin.mpg.de:9015 echo Finito diff --git a/updatestatic.sh b/updatestatic.sh index 203d3f9..8f7b257 100755 --- a/updatestatic.sh +++ b/updatestatic.sh @@ -1,10 +1,15 @@ #!/usr/bin/zsh -rsync -Pazy /var/www/eoa /home/kthoden/backups/eoa_$(date -I) -sudo rsync -Pazy /home/kthoden/static/eoa/eoa2-production.mpiwg-berlin.mpg.de:9005/ /var/www/eoa/html -rsync -Pazy /var/www/eos /home/kthoden/backups/eos_$(date -I) -sudo rsync -Pazy --exclude-from=/home/kthoden/updatestaticexcludefile /home/kthoden/static/eos/eoa2-production.mpiwg-berlin.mpg.de:9010/ /var/www/eos/html -rsync -Pazy /var/www/mprl /home/kthoden/backups/mprl_$(date -I) -sudo rsync -Pazy --exclude-from=/home/kthoden/updatestaticexcludefile /home/kthoden/static/mprl/eoa2-production.mpiwg-berlin.mpg.de:9015/ /var/www/mprl/html +EOA_STATIC_DIR=/home/eoauser/static +MAKE_STATIC_PY=/home/eoauser/src/eoa_makestatic/makestatic.py +EOA_SRC_DIR=/home/eoauser/src + +echo Backing up with rsnapshot +rsnapshot -c /home/eoauser/etc/rsnapshot.conf alpha + +echo Sync the new pages +sudo rsync -Pazy $EOA_STATIC_DIR/eoa/eoa2-production.mpiwg-berlin.mpg.de:9005/ /var/www/eoa/html +sudo rsync -Pazy --exclude-from=/home/eoauser/updatestaticexcludefile $EOA_STATIC_DIR/eos/eoa2-production.mpiwg-berlin.mpg.de:9010/ /var/www/eos/html +sudo rsync -Pazy --exclude-from=/home/eoauser/updatestaticexcludefile $EOA_STATIC_DIR/mprl/eoa2-production.mpiwg-berlin.mpg.de:9015/ /var/www/mprl/html echo Finito