1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-28 20:18:15 +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 DB_FILE /data/db.sqlite3
ENV BACKUP_FILE /data/db_backup/backup.sqlite3 ENV BACKUP_FILE /data/db_backup/backup.sqlite3
ENV BACKUP_FILE_PERMISSIONS 600
ENV CRON_TIME "0 5 * * *" ENV CRON_TIME "0 5 * * *"
ENV TIMESTAMP false ENV TIMESTAMP false
ENV UID 100 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 | | DB_FILE | Path to the Bitwarden sqlite3 database *inside* the container |
| BACKUP_FILE | Path to the desired backup location *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" | | 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` | | TIMESTAMP | Set to `true` to append timestamp to the `BACKUP_FILE` |
| UID | User ID to run the cron job with | | UID | User ID to run the cron job with |

View File

@ -15,7 +15,7 @@ else
fi fi
/usr/bin/sqlite3 $DB_FILE ".backup $FINAL_BACKUP_FILE" /usr/bin/sqlite3 $DB_FILE ".backup $FINAL_BACKUP_FILE"
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "$(date "+%F %T") - Backup successfull" echo "$(date "+%F %T") - Backup successfull"
else else

View File

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