Script per fer una copia de seguretat diaria del WordPress

Via gfmorris he trobat aquest script de shell per a fer una copia de seguretat d’un blog amb WordPress.

#!/bin/csh -f

# Determine current date
setenv CURDATE date +%Y%m%d

# Backup all WP databases to compressed, dated file in home directory
mysqldump -q -e -hlocalhost -u[user] -p[pass] [database] | gzip - > ~/${CURDATE}_db-backup.sql.gz

# Backup WP files to compressed, dated file in home directory
cd ~/path/to/wp-files/
tar cf - . | gzip - > ~/${CURDATE}_files.tar.gz