Skip to content

Instantly share code, notes, and snippets.

@jmwenda
Created November 7, 2011 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmwenda/1346090 to your computer and use it in GitHub Desktop.
Save jmwenda/1346090 to your computer and use it in GitHub Desktop.
GeoNode Script to Back up directory and files
#!/bin/bash
# Backup script, meant to me run at the geonode mirror.
# Make sure to enable passwordless access from the mirror to the original site.
# Authors: Jude Mwenda, Ariel Nunez
# http://github.com/GFDRR
#NOTE: This tool requires pgsql_schema_diff.py to be installed first
# cd /usr/bin
# https://raw.github.com/gist/380278/140b133ea52e55e63ea2bfae9630e14f22c80ac9/pgsql_schema_diff.py
# chmod +x pgsql_schema_diff.py
#FIXME: Add parameters on actual host then the directory and then the destination/ Mirror or backup. That is
#geonode-backup -d /data -s horn.rcmrd.org --t localhost - back up to mirror instance
#geonode-backup /data - backup to local directory
#geonode-backup /data --source=geonode@horn.rcmrd.org - back up to directory from live
#geonode-backup /data --source=geonode@horn.rcmrd.org --target=localhost - backup from live to mirror
#geonode-backup /data --source=geonode@horn.rcmrd.org --target=ubuntu@ - backup from live to mirror
if [ $# -eq 0 ];then
echo "Usage:"
echo " geonode-backup username@host backup_dir"
exit 0
else
args=("$@")
HOST=${args[0]}
BACKUP_DIR=${args[1]}
#FIXME(Jude): Make --mirror an option to the script. For now it is always enabled.
MIRROR=1
fi
#FIXME(Jude): Save the latest backup appending the date to it. Like geonode-2011-10-23.db
@jmwenda
Copy link
Author

jmwenda commented Nov 7, 2011

cd /usr/bin;sudo rm -rf geonode-bckup;sudo wget https://raw.github.com/gist/1346090/geonode-bckup; sudo chmod +x geonode-bckup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment