Difference between revisions of "Cedeus DB backups"

From stgo
Jump to: navigation, search
(How to set up Backups)
(copy of the geonode DB)
Line 13: Line 13:
 
# create a cron-tab entry for admin/root user using "<code>crontab -e</code>"
 
# create a cron-tab entry for admin/root user using "<code>crontab -e</code>"
 
#: then add entry such as "<code>00 01 * * * /home/ssteinig/geonode_backup.sh</code>" to run the script daily at 1:00 am
 
#: then add entry such as "<code>00 01 * * * /home/ssteinig/geonode_backup.sh</code>" to run the script daily at 1:00 am
#: => when using the user "postgres" then pg_hba.conf file needs to adjusted to trust local connections. See:
+
#: => when using the user "postgres" then
#:* http://stackoverflow.com/questions/15359348/run-batch-file-with-psql-command-without-password and
+
#:* check if postgres user has a password assigned already (use ALTER... to do so: http://wiki.geosteiniger.cl/mediawiki-1.22.7/index.php/Setting_up_geonode#Some_PostgreSQL_commands )
#:* http://help.ubuntu.com/10.04/serverguide/postgresql.html
+
#:* create a .pgpass file to provide the password: http://wiki.postgresql.org/wiki/Pgpass
#: => in particular I changed "<code>local all postgres peer</code>" to: "<code>local all postgres md5</code>"
+

Revision as of 19:20, 1 December 2014

>> return to Cedeus_IDE


How to set up Backups

notifications

To get notified about the backups via email, a/the shell script may send emails via "mailx" - i.e Nail. => see http://klenwell.com/press/2009/03/ubuntu-email-with-nail/

copy of the geonode DB

  1. create a shell script that contains the pgdump instructions - see /home/ssteinig/geonode_backup.sh on CedeusDB
  2. test if script actually works (using sudo?)
  3. create a cron-tab entry for admin/root user using "crontab -e"
    then add entry such as "00 01 * * * /home/ssteinig/geonode_backup.sh" to run the script daily at 1:00 am
    => when using the user "postgres" then