Fix weekly_backup()
This commit is contained in:
parent
0a826ecc1a
commit
ee702449f0
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue