mirror of
https://github.com/psenough/pouet.net.git
synced 2025-01-17 05:08:24 +01:00
19 lines
491 B
Bash
Executable File
19 lines
491 B
Bash
Executable File
#!/bin/sh
|
|
|
|
BACKUP_FOLDER=/home/hosted/pouet/backup
|
|
CONTENT_FOLDER=/home/hosted/pouet/sites/content.pouet.net
|
|
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
|
|
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
|