From c5b2892be937cabd48c479ec73ddcd82ca42a3a3 Mon Sep 17 00:00:00 2001 From: Dan Wild Date: Thu, 6 Feb 2020 10:57:50 +1100 Subject: [PATCH] add data import to entrypoint script https://github.com/belsander/docker-cronicle/issues/24 --- README.md | 7 +++++++ entrypoint.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 8005b6f..841fe20 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,13 @@ and restart the Docker container: ```sh /path-to-cronicle-storage/data/.setup_done ``` +### Import data +A previously [exported data file](https://github.com/jhuckaby/Cronicle#data-import-and-export) can be provided in the following location: + +```sh +/path-to-cronicle-storage/data/backup.txt.import +``` +The file will get loaded the very first time Cronicle is started. ## Web UI credentials The default credentials for the web interface are: `admin` / `admin` diff --git a/entrypoint.sh b/entrypoint.sh index e8b4020..65138f8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,6 +28,12 @@ then cp $DATA_DIR/config.json.import $CONF_DIR/config.json fi + # load exported data if present + if [ -f $DATA_DIR/backup.txt.import ] + then + $BIN_DIR/control.sh import $DATA_DIR/backup.txt.import + fi + # Create plugins directory mkdir -p $PLUGINS_DIR