diff --git a/wikibackup.sh b/wikibackup.sh index 60e9243..03772f0 100644 --- a/wikibackup.sh +++ b/wikibackup.sh @@ -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 \ No newline at end of file +esac