diff --git a/README.md b/README.md index 79c16a5..c117fae 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ docker run -d --restart=always --name bitwarden_backup --volumes-from=bitwarden You can use the crontab of your host to schedule the backup and the container will only be running during the backup process. ```sh -docker run --rm --volumes-from=bitwarden --entrypoint sqlite3 bruceforce/bw_backup $DB_FILE ".backup $BACKUP_FILE" +docker run --rm --volumes-from=bitwarden bruceforce/bw_backup manual ``` Keep in mind that the above command will be executed inside the container. So @@ -36,7 +36,7 @@ If you want the backed up file to be stored outside the container you have to mo a directory by adding `-v :`. The complete command could look like this ```sh -docker run --rm --volumes-from=bitwarden -v /tmp/myBackup:/myBackup --entrypoint sqlite3 bruceforce/bw_backup /data/db.sqlite3 ".backup /myBackup/backup.sqlite3" +docker run --rm --volumes-from=bitwarden -e UID=0 -e BACKUP_FILE=/myBackup/backup.sqlite3 -e TIMESTAMP=true -v /tmp/myBackup:/myBackup bruceforce/bw_backup manual ``` ## Environment variables diff --git a/backup.sh b/backup.sh index 63c8167..a76607d 100644 --- a/backup.sh +++ b/backup.sh @@ -17,7 +17,7 @@ fi /usr/bin/sqlite3 $DB_FILE ".backup $FINAL_BACKUP_FILE" if [ $? -eq 0 ] then - echo "$(date "+%F %T") - Backup successfull" + echo "$(date "+%F %T") - Backup successfull to $FINAL_BACKUP_FILE" else echo "$(date "+%F %T") - Backup unsuccessfull" fi diff --git a/entrypoint.sh b/entrypoint.sh index c2a9363..452a908 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ fi # Just run the backup script if [ "$1" = "manual" ]; then $BACKUP_CMD + exit 0 fi # Initialize cron