mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 06:18:15 +03:00
Merge branch 'timestamp' into 'master'
Timestamp See merge request 1O/bitwarden_rs-backup!1
This commit is contained in:
commit
ea0d2ac96d
@ -8,6 +8,7 @@ COPY start.sh backup.sh /
|
||||
ENV DB_FILE /data/db.sqlite3
|
||||
ENV BACKUP_FILE /data/db-backup.sqlite3
|
||||
ENV CRON_TIME "0 5 * * *"
|
||||
ENV TIMESTAMP false
|
||||
|
||||
RUN chmod 700 /start.sh /backup.sh
|
||||
|
||||
|
@ -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 |
|
||||
| BACKUP_FILE | Path to the desired backup location |
|
||||
| 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` |
|
||||
|
@ -1,9 +1,14 @@
|
||||
#!/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"
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "$(date) - Backup successfull"
|
||||
echo "$(date "+%F %T") - Backup successfull"
|
||||
else
|
||||
echo "$(date) - Backup unsuccessfull"
|
||||
echo "$(date "+%F %T") - Backup unsuccessfull"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user