Difference between revisions of "Cedeus DB backups"

From stgo
Jump to: navigation, search
(How to set up Backups)
(copy of the geonode DB)
Line 9: Line 9:
  
 
=== copy of the geonode DB ===
 
=== copy of the geonode DB ===
# create a shell script that contains the pgdump instructions - see /home/ssteinig/geonode_backup.sh on CedeusDB
+
* create a shell script that contains the pgdump instructions - see /home/ssteinig/pgdbbackup.sh on CedeusDB
# test if script actually works (using sudo?)
+
* test if script or script execution actually works. A simple script for testing may perhaps be this (/home/ssteinig/touchy.sh)
# create a cron-tab entry for ssteinig user using "<code>crontab -e</code>"
+
*: <code>
#: then add entry such as "<code>00 01 * * * /home/ssteinig/pgdbbackup.sh</code>" to run the script daily at 1:00 am
+
#!/bin/bash
#: => when using the user "postgres" then
+
touch /home/ssteinig/ftw.text</code>
#:* 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 )
+
* create a cron-tab entry for ssteinig user using "<code>crontab -e</code>"
#:* create a .pgpass file to provide the password: http://wiki.postgresql.org/wiki/Pgpass
+
*: then add entry such as "<code>00 01 * * * sh /home/ssteinig/pgdbbackup.sh</code>" to run the script daily at 1:00 am
# check also if the cron is running <code>sudo service cron status</code> otherwise start it...
+
*: => when using the user "postgres" then
# to see what the cron tab contains use <code>crontab -l</code>
+
*:* 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 )
 +
*:* create a .pgpass file to provide the password: http://wiki.postgresql.org/wiki/Pgpass
 +
* check also if the cron is running <code>sudo service cron status</code> otherwise start it...
 +
* to see what the cron tab contains use <code>crontab -l</code>

Revision as of 17:18, 2 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

  • create a shell script that contains the pgdump instructions - see /home/ssteinig/pgdbbackup.sh on CedeusDB
  • test if script or script execution actually works. A simple script for testing may perhaps be this (/home/ssteinig/touchy.sh)
#!/bin/bash 
touch /home/ssteinig/ftw.text