|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
DST_DIR=/backups
|
|
|
|
|
KEEP_DAYS=28
|
|
|
|
|
APP_ROOT=/var/www/html/tt-rss
|
|
|
|
|
|
|
|
|
|
if pg_isready -h $DB_HOST -U $DB_USER; then
|
|
|
|
|
DST_FILE=ttrss-backup-$(date +%Y%m%d).sql.gz
|
|
|
|
@ -12,9 +13,17 @@ if pg_isready -h $DB_HOST -U $DB_USER; then
|
|
|
|
|
|
|
|
|
|
pg_dump --clean -h $DB_HOST -U $DB_USER $DB_NAME | gzip > $DST_DIR/$DST_FILE
|
|
|
|
|
|
|
|
|
|
DST_FILE=ttrss-backup-$(date +%Y%m%d).tar.gz
|
|
|
|
|
|
|
|
|
|
echo backing up tt-rss local directories to $DST_DIR/$DST_FILE...
|
|
|
|
|
|
|
|
|
|
tar -cz -f $DST_DIR/$DST_FILE $APP_ROOT/*.local \
|
|
|
|
|
$APP_ROOT/feed-icons/ \
|
|
|
|
|
$APP_ROOT/config.php
|
|
|
|
|
|
|
|
|
|
echo cleaning up...
|
|
|
|
|
|
|
|
|
|
find $DST_DIR -type f -name '*.sql.gz' -mtime +$KEEP_DAYS -delete
|
|
|
|
|
find $DST_DIR -type f -name '*.gz' -mtime +$KEEP_DAYS -delete
|
|
|
|
|
|
|
|
|
|
echo done.
|
|
|
|
|
else
|