diff --git a/Dockerfile b/Dockerfile index b85440f3..6d0be0d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,5 @@ WORKDIR /root RUN apk add --no-cache ca-certificates COPY --from=builder /app/cmd/backup/backup /usr/bin/backup -COPY --chmod=755 ./entrypoint.sh /root/ ENTRYPOINT ["/usr/bin/backup", "-foreground"] diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index edbf6c9a..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# Copyright 2021 - Offen Authors -# SPDX-License-Identifier: MPL-2.0 - -set -e - -if [ ! -d "/etc/dockervolumebackup/conf.d" ]; then - BACKUP_CRON_EXPRESSION="${BACKUP_CRON_EXPRESSION:-@daily}" - - echo "Installing cron.d entry with expression $BACKUP_CRON_EXPRESSION." - echo "$BACKUP_CRON_EXPRESSION backup 2>&1" | crontab - -else - echo "/etc/dockervolumebackup/conf.d was found, using configuration files from this directory." - - crontab -r && crontab /dev/null - for file in /etc/dockervolumebackup/conf.d/*; do - source $file - BACKUP_CRON_EXPRESSION="${BACKUP_CRON_EXPRESSION:-@daily}" - echo "Appending cron.d entry with expression $BACKUP_CRON_EXPRESSION and configuration file $file" - (crontab -l; echo "$BACKUP_CRON_EXPRESSION /bin/sh -c 'set -a; source $file; set +a && backup' 2>&1") | crontab - - done -fi - -echo "Starting cron in foreground." -crond -f -d 8 diff --git a/go.mod b/go.mod index 9987c30a..7147ca09 100644 --- a/go.mod +++ b/go.mod @@ -10,12 +10,14 @@ require ( github.com/docker/cli v24.0.1+incompatible github.com/docker/docker v24.0.7+incompatible github.com/gofrs/flock v0.8.1 + github.com/joho/godotenv v1.5.1 github.com/klauspost/compress v1.17.6 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/minio/minio-go/v7 v7.0.66 github.com/offen/envconfig v1.5.0 github.com/otiai10/copy v1.14.0 github.com/pkg/sftp v1.13.6 + github.com/robfig/cron/v3 v3.0.0 github.com/studio-b12/gowebdav v0.9.0 golang.org/x/crypto v0.18.0 golang.org/x/oauth2 v0.16.0 @@ -28,8 +30,6 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.0 // indirect github.com/golang/protobuf v1.5.3 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - github.com/joho/godotenv v1.5.1 // indirect - github.com/robfig/cron/v3 v3.0.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect )