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

Added timestamp support

This commit is contained in:
10 2018-11-18 02:37:01 +01:00
parent e551725d7a
commit e9ac54cebf
3 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@ COPY start.sh backup.sh /
ENV DB_FILE /data/db.sqlite3 ENV DB_FILE /data/db.sqlite3
ENV BACKUP_FILE /data/db-backup.sqlite3 ENV BACKUP_FILE /data/db-backup.sqlite3
ENV CRON_TIME "0 5 * * *" ENV CRON_TIME "0 5 * * *"
ENV TIMESTAMP false
RUN chmod 700 /start.sh /backup.sh RUN chmod 700 /start.sh /backup.sh

View File

@ -38,4 +38,4 @@ docker run --rm --volumes-from=bitwarden registry.gitlab.com/1o/bitwarden_rs-bac
| DB_FILE | Path to the Bitwarden sqlite3 database | | DB_FILE | Path to the Bitwarden sqlite3 database |
| BACKUP_FILE | Path to the desired backup location | | BACKUP_FILE | Path to the desired backup location |
| 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` |

View File

@ -1,5 +1,10 @@
#!/bin/sh #!/bin/sh
if [ $TIMESTAMP = true ]
then
BACKUP_FILE="$(echo $BACKUP_FILE)_$(date "+%F-%H%M%S")"
fi
/usr/bin/sqlite3 $DB_FILE ".backup $BACKUP_FILE" /usr/bin/sqlite3 $DB_FILE ".backup $BACKUP_FILE"
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then