mirror of
https://github.com/psenough/pouet.net.git
synced 2025-01-17 13:18:24 +01:00
Improved the backup script
This commit is contained in:
parent
a1eaf620b0
commit
10193b82cc
@ -6,11 +6,13 @@ DATE=`date +"%Y-%m-%d"`
|
||||
SQL_DUMP_FILE=$BACKUP_FOLDER/pouet-$DATE.sql
|
||||
|
||||
# Backup the database
|
||||
rm -f $SQL_DUMP_FILE.gz
|
||||
mysqldump pouet > $SQL_DUMP_FILE
|
||||
gzip $SQL_DUMP_FILE
|
||||
|
||||
# Backup the user submitted files
|
||||
tar zcf $BACKUP_FOLDER/pouet-content-$DATE.tgz $CONTENT_FOLDER
|
||||
rm -f $BACKUP_FOLDER/pouet-content-$DATE.tgz
|
||||
tar -z -c -f $BACKUP_FOLDER/pouet-content-$DATE.tgz -C $CONTENT_FOLDER .
|
||||
|
||||
# Cleanup old files
|
||||
find $BACKUP_FOLDER -mtime 15 -delete
|
||||
find $BACKUP_FOLDER -mtime +15 -delete
|
||||
|
Loading…
x
Reference in New Issue
Block a user