You are here

db_dump.sh in Open Atrium 7.2

#!/bin/bash

# Configuration variables
drupal_root="/opt/development/integration/drupal"
backup_dest="/opt/backups"
dbname="oa-integration.sql"

# Make sure the backup directory is available
if [ ! -d ${backup_dest} ]; then
	  echo backup_dest="/opt/development/integration"
  fi

  # Make sure the backup directory is available
  if [ ! -d ${backup_dest} ]; then
	    echo "Backup directory /opt/backups is missing or not writeable... exiting."; exit 1
    else
	      echo "Starting integration db dump"
      fi

      # Dump our SQL DATABASE
      drush -r ${drupal_root} sql-dump > ${backup_dest}/${dbname}

      echo "Backup for integratoin created: ${backup_dest}/${dbname}"

File

scripts/db_dump.sh
View source
  1. #!/bin/bash
  2. # Configuration variables
  3. drupal_root="/opt/development/integration/drupal"
  4. backup_dest="/opt/backups"
  5. dbname="oa-integration.sql"
  6. # Make sure the backup directory is available
  7. if [ ! -d ${backup_dest} ]; then
  8. echo backup_dest="/opt/development/integration"
  9. fi
  10. # Make sure the backup directory is available
  11. if [ ! -d ${backup_dest} ]; then
  12. echo "Backup directory /opt/backups is missing or not writeable... exiting."; exit 1
  13. else
  14. echo "Starting integration db dump"
  15. fi
  16. # Dump our SQL DATABASE
  17. drush -r ${drupal_root} sql-dump > ${backup_dest}/${dbname}
  18. echo "Backup for integratoin created: ${backup_dest}/${dbname}"