merge request and linting fixes

This commit is contained in:
Jensa 2023-05-12 16:52:38 +02:00
parent 55f759e552
commit 2b2b409337
2 changed files with 8 additions and 20 deletions

View File

@ -4,7 +4,7 @@ version: '3'
services:
zammad-backup:
command: ["zammad-timed-backup"]
command: ["zammad-backup"]
depends_on:
- zammad-railsserver
- zammad-postgresql

View File

@ -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