Skip to content

Instantly share code, notes, and snippets.

@matiskay
Created January 13, 2012 17:12
Show Gist options
  • Save matiskay/1607578 to your computer and use it in GitHub Desktop.
Save matiskay/1607578 to your computer and use it in GitHub Desktop.
Backuping script
#!/bin/bash
date_stamp=$(date +%y-%m-%d-%H-%M-%S)
WP_PATH=''
DB_NAME=''
DB_USER=''
DB_PASS=''
BACKUP_PATH=''
mkdir ${BACKUP_PATH}/${date_stamp}
cd ${BACKUP_PATH}/${date_stamp}
cd $WP_PATH && tar cfz wp-${date_stamp}.tar.gz .
mysqldump $DB_NAME --user=$DB_USER --password=$DB_PASS > guia-virtual-${date_stamp}.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment