A script for backing up WordPress & drupal

I use this script to backup our wordpress & drupal file systems:

#!/bin/sh
path=~/path/to/backups/ #set the path variable to where you want the backups
filename1=$path”monthlyWordpress_Drupal_Backups”`eval date +%Y%m%d`”.tar” #tell it what to call the backups
#`eval date +%Y%m%d` will give you year, month and day(ie. 20110720)
tar cvf $filename1 ~/path/to/wordpress/wp-* #backup wordpress files
tar rvf $filename1 ~/path/to/drupal #backup drupal files
find ~/path/to/backups/ -name ‘monthlyWordpress_Drupal_Backups*’ -mtime +90 -delete
#find backup files older than specified time (-mtime +90 = older than 90 days) & delete them

Feel free to use

2 Responses Subscribe to comments


  1. Eric

    Thanks for the script!

    Sep 12, 2011 @ 11:52 pm


  2. Pokies

    thanks for sharing this script.. :)

    Feb 28, 2012 @ 11:43 pm

Reply