Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/sh_backup_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DB_NAME=mpop_database
DUMP_DIR=~/backups
DATE_NOW=$(date +%Y-%m-%d_%Hh%Mm%S)
DELETE_OLDER_THAN=180 # days
DO_DELETE_OLD_FILES=false
DO_DELETE_OLD_FILES=true

echo Date and time: ${DATE_NOW}

Expand All @@ -20,10 +20,10 @@ mysqldump -u ${DB_USER} -p${DB_PASS} ${DB_NAME} > \
# Delete files older than N days:

echo "Old files:"
find ${DUMP_DIR} -type f -mtime +${DELETE_OLDER_THAN}
find ${DUMP_DIR} -type f -name \*.sql -mtime +${DELETE_OLDER_THAN}
if [ ${DO_DELETE_OLD_FILES} == true ];
then
find ${DUMP_DIR} -type f -mtime +${DELETE_OLDER_THAN} \
find ${DUMP_DIR} -type f -name \*.sql -mtime +${DELETE_OLDER_THAN} \
-exec rm {} +
fi

6 changes: 5 additions & 1 deletion scripts/sh_rsync_dataviz-b.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
# Copies the backups to another computer

rsync -a ~/backups/* dataviz-b:backups/
rsync --archive \
--verbose \
--human-readable \
--delete-before \
~/backups/ dataviz-b:backups/

Loading