1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-28 21:38:14 +03:00

Added ENV BACKUP_FILE_PERMISSIONS to set permissions of the backup file

This commit is contained in:
1O 2020-09-16 19:17:41 +02:00
parent bc6c9b6d48
commit 7f585e3fd1
4 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ RUN apk add --no-cache \
ENV DB_FILE /data/db.sqlite3
ENV BACKUP_FILE /data/db_backup/backup.sqlite3
ENV BACKUP_FILE_PERMISSIONS 600
ENV CRON_TIME "0 5 * * *"
ENV TIMESTAMP false
ENV UID 100

View File

@ -44,6 +44,7 @@ docker run --rm --volumes-from=bitwarden -v /tmp/myBackup:/myBackup --entrypoint
| ----- | ----- |
| DB_FILE | Path to the Bitwarden sqlite3 database *inside* the container |
| BACKUP_FILE | Path to the desired backup location *inside* the container |
| BACKUP_FILE_PERMISSIONS | Sets the permissions of the backup file |
| CRON_TIME | Cronjob format "Minute Hour Day_of_month Month_of_year Day_of_week Year" |
| TIMESTAMP | Set to `true` to append timestamp to the `BACKUP_FILE` |
| UID | User ID to run the cron job with |

View File

@ -9,7 +9,8 @@ BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
if [ ! -d $(dirname "$BACKUP_FILE") ]
then
mkdir -p $(dirname "$BACKUP_FILE")
chown $UID:$GID $(dirname "$BACKUP_FILE")
chown -R $UID:$GID $(dirname "$BACKUP_FILE")
chmod -R "$BACKUP_FILE_PERMISSIONS" $(dirname "$BACKUP_FILE")
fi
# For compatibility reasons