merge request and linting fixes
This commit is contained in:
parent
55f759e552
commit
2b2b409337
@ -4,7 +4,7 @@ version: '3'
|
||||
services:
|
||||
|
||||
zammad-backup:
|
||||
command: ["zammad-timed-backup"]
|
||||
command: ["zammad-backup"]
|
||||
depends_on:
|
||||
- zammad-railsserver
|
||||
- zammad-postgresql
|
||||
|
@ -38,32 +38,20 @@ function zammad_backup {
|
||||
echo "backup finished :)"
|
||||
}
|
||||
|
||||
if [ "$1" = 'zammad-timed-backup' ]; then
|
||||
|
||||
check_railsserver_available
|
||||
|
||||
while true; do
|
||||
NOW_TIMESTAMP=`date +%s`
|
||||
TOMORROW_DATE=`date -d@"$(( $NOW_TIMESTAMP + 24*60*60 ))" +%Y-%m-%d`
|
||||
|
||||
zammad_backup
|
||||
|
||||
NEXT_TIMESTAMP=`date -d "$TOMORROW_DATE $BACKUP_TIME" +%s`
|
||||
NOW_TIMESTAMP=`date +%s`
|
||||
|
||||
sleep $(( ${NEXT_TIMESTAMP} - ${NOW_TIMESTAMP} ))
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$1" = 'zammad-backup' ]; then
|
||||
|
||||
check_railsserver_available
|
||||
|
||||
while true; do
|
||||
NOW_TIMESTAMP=$(date +%s)
|
||||
TOMORROW_DATE=$(date -d@"$(( $NOW_TIMESTAMP + 24*60*60 ))" +%Y-%m-%d)
|
||||
|
||||
zammad_backup
|
||||
|
||||
# wait until next backup
|
||||
sleep "${BACKUP_SLEEP}"
|
||||
NEXT_TIMESTAMP=$(date -d "$TOMORROW_DATE $BACKUP_TIME" +%s)
|
||||
NOW_TIMESTAMP=$(date +%s)
|
||||
|
||||
sleep $(( $NEXT_TIMESTAMP - $NOW_TIMESTAMP ))
|
||||
done
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user