Fix weekly_backup()

This commit is contained in:
Jay Logan 2019-08-20 05:06:58 -05:00
parent 0a826ecc1a
commit ee702449f0
1 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
# Backup script for MediaWiki instaillations using SQLite database
# Script assumes backup dir structure of:
# $backup_path
# |- daily
@ -28,10 +30,10 @@ weekly_backup() {
cd $mw_path
tar zcvhf $backup_path/weekly/$(date -I)/$weekly_tarball.tgz ./mediawiki
cp $backup_path/daily/$(date -I).sqlite $backup_path/weekly/$weekly_db.sqlite
cp $backup_path/daily/$(date -I).sqlite $backup_path/weekly/$(date -I)/$weekly_db.sqlite
cd $backup_path/weekly
find . -mtime 28 -type d -delete
find . ! -path . -mtime 28 -type d -exec rm -rf {} +
}
case $1 in
@ -43,4 +45,4 @@ case $1 in
;;
*)
;;
esac
esac