j7backalllocal 939 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Script to backup jovian web platform locally
  3. echo 'Backing up jovian platform ...'
  4. # Backup all postgres just in case
  5. echo 'Backing up PostgreSQL ...'
  6. sudo -u postgres pg_dumpall > /home/jovian/Local/Backup/Postgres/dumpfile
  7. echo 'PostgreSQL done.'
  8. echo 'Backing up GOGS ...'
  9. sudo -u gituser /home/gituser/gogs/gogs backup --target /home/gituser/
  10. sudo mv /home/gituser/gogs-backup-2* /home/jovian/Local/Backup/Gogs/
  11. sudo chown jovian:jovian /home/jovian/Local/Backup/Gogs/gogs-backup-2*
  12. echo 'GOGS done.'
  13. echo 'Backing up KANBOARD ...'
  14. sudo -u postgres pg_dump kanboard_db > /home/jovian/Local/Backup/Postgres/kanboard_dumpfile
  15. echo 'KANBOARD done.'
  16. echo 'Backing up WIKI ...'
  17. echo '> wiki db ...'
  18. sudo -u postgres pg_dump wiki_db > /home/jovian/Local/Backup/Postgres/wiki_dumpfile
  19. echo '> wiki files ...'
  20. tar chf /home/jovian/Local/Backup/Wiki/mediawiki.tar /var/www/mediawiki
  21. echo 'WIKI done.'
  22. echo 'Platform saved.'