mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 10:58:15 +03:00
parent
b9fe712fda
commit
1a200567eb
@ -24,12 +24,12 @@ You can use the crontab of your host to schedule the backup and the container wi
|
|||||||
|
|
||||||
Example using the integrated Backup script. You can use Environment variables for database and backup location
|
Example using the integrated Backup script. You can use Environment variables for database and backup location
|
||||||
```sh
|
```sh
|
||||||
docker run --rm --volumes-from=bitwarden bruceforce/bw_backup /backup.sh
|
docker run --rm --volumes-from=bitwarden bruceforce/bw_backup manual
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to run the sqlite commands manually you can use the following command
|
If you want to run the sqlite commands manually you can use the following command
|
||||||
```sh
|
```sh
|
||||||
docker run --rm --volumes-from=bitwarden bruceforce/bw_backup sqlite3 $DB_FILE ".backup $BACKUP_FILE"
|
docker run --rm --volumes-from=bitwarden --entrypoint sqlite3 bruceforce/bw_backup $DB_FILE ".backup $BACKUP_FILE"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
|
14
entrypoint.sh
Normal file → Executable file
14
entrypoint.sh
Normal file → Executable file
@ -1,9 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# vim: tabstop=2 shiftwidth=2 expandtab
|
||||||
|
|
||||||
#set -ux
|
#set -ux
|
||||||
|
|
||||||
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
|
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
|
||||||
|
|
||||||
|
# For compatibility reasons
|
||||||
|
if [ "$1" = "/backup.sh" ]; then
|
||||||
|
>&2 echo "Using /backup.sh is deprecated and will be removed in future versions! Please use \`manual\` as arugment instead"
|
||||||
|
$BACKUP_CMD
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Just run the backup script
|
||||||
|
if [ "$1" = "manual" ]; then
|
||||||
|
$BACKUP_CMD
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Initialize cron
|
||||||
echo "Running as $(id)"
|
echo "Running as $(id)"
|
||||||
if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; then
|
||||||
echo "Initalizing..."
|
echo "Initalizing..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user