2019-01-09 11:55:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Get date in dd-mm-yyyy format
|
|
|
|
NOW="$(date +"%d-%m-%Y")"
|
|
|
|
|
|
|
|
function file_backup {
|
|
|
|
wpbackupfile="wordpress-backup-$NOW.tar.gz"
|
|
|
|
oxidbackupfile="oxid-back-$NOW.tar.gz"
|
|
|
|
|
|
|
|
echo 'WP Files Backup --- building tar File...'
|
|
|
|
tar -czf $wpbackupfile /var/html/www/rvv/wp*
|
|
|
|
echo '+DONE'
|
|
|
|
|
|
|
|
echo 'oxid Files Backup --- building tar File...'
|
|
|
|
tar -czf $oxidbackupfile /var/html/www/rvv/shop
|
2019-01-09 11:57:54 +01:00
|
|
|
|
2019-01-09 11:55:18 +01:00
|
|
|
echo '+DONE'
|
|
|
|
}
|
|
|
|
|
|
|
|
function oxid_db_backup {
|
|
|
|
host=localhost
|
|
|
|
user=rvv
|
|
|
|
pass=xxxxxxxxx
|
|
|
|
db=webshop
|
|
|
|
|
|
|
|
echo 'oxid DB Export ------> '
|
|
|
|
mysqldump --opt --add-drop-table -h$host -u$user -p$pass $db | gzip > oxid-db-$NOW.sql.gz
|
|
|
|
}
|
|
|
|
|
|
|
|
backupdir=~/backup
|
|
|
|
cd ~ ; mkdir $backupdir ; cd $backupdir
|
|
|
|
|
|
|
|
oxid_db_backup
|
|
|
|
file_backup
|
|
|
|
|
|
|
|
# delete old backups
|
2019-01-09 11:57:54 +01:00
|
|
|
find $backupdir -mtime +10 -type f -delete
|