Fix weekly_backup()

This commit is contained in:
Jay Logan 2019-08-20 05:06:58 -05:00
parent 0a826ecc1a
commit ee702449f0

View file

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