Skip to content

Commit

Permalink
Updated backup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
gzachos committed Aug 29, 2016
1 parent 2725ce2 commit b5244e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ by compressing and storing them. It is designed to be executed @midnight (same a

Details
-------
- Every "\<token-uppercase\>\_BACKUP\_DAY" a backup is taken, unless a backup was
already taken this week.
- Every "\<token-uppercase\>\_BACKUP\_DAY" a backup is taken.
- If no backup was taken the previous week (Mon -> Sun) **AND** if no backup
was taken this week, a backup is taken no matter what.
- Backups older than 5 weeks (counting current week) are deleted unless the
Expand Down
9 changes: 4 additions & 5 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
# Example cron entry:
# @midnight /root/bin/backup.sh
#
# Details: Every "<token-uppercase>_BACKUP_DAY" a backup is taken,
# unless a backup was already taken this week. If no backup was
# taken the previous week (Mon -> Sun) AND if no backup was taken
# this week, a backup is taken no matter what.
# Details: Every "<token-uppercase>_BACKUP_DAY" a backup is taken.
# If no backup was taken the previous week (Mon -> Sun) AND if no
# backup was taken this week, a backup is taken no matter what.
#
# Backups older than 5 weeks (counting current week) are deleted unless
# the total number of backups is less than 6 (<=5).
Expand Down Expand Up @@ -318,7 +317,7 @@ check_backups () {
fi
done

if [ ${week} -eq 1 ] && [ "${TODAY}" == "${!BACKUP_DAY}" ] && [ ${FILENUM} -eq 0 ]
if [ ${week} -eq 1 ] && [ "${TODAY}" == "${!BACKUP_DAY}" ]
then
conduct_backup ${1}
((FILENUM++))
Expand Down

0 comments on commit b5244e5

Please sign in to comment.