www:
#!/bin/sh
#Backup
DIR_WWW_BAK="/data/backups/www"
#Web-Root
DIR_WWW="/var/www/vhosts/domain.net/"
#Webroot
DATUM2=`date '+%d-%m-%Y-%H:%M:%S'`
tar -czvf $DIR_WWW_BAK/domain.net-backup_webroot-${DATUM2}.tar.gz $DIR_WWW
#ncftpput -R -v -u "ftptest" -p "test" server.domain.com / $DIR
#ncftpput -R -v -u "ftptest" -p "test" server.domain.com / $DIR_WWW_BAK
#clear
find $DIR_WWW_BAK -name \*.tar.gz -mtime +3 -exec rm {} \;
Mysql:
#!/bin/sh
#Backup-db
DIR="/data/backups/mysql"
DATUM=`date '+%d-%m-%Y-%H:%M:%S'`
#backup
mysqldump -u dbusername --password='dbpassword' -h localhost dbname |gzip -9 --best > $DIR/domain.net-backup-${DATUM}.sql.gz
#clear
find $DIR -name \*.sql.gz -mtime +7 -exec rm {} \;