From 1e4c264ca0b3b4210413d40bf138edc5e0336a35 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 17 May 2023 14:27:55 +0200 Subject: [PATCH] Backup at startup --- .idea/.gitignore | 8 ++++++++ .idea/docker-backup-duplicity.iml | 9 +++++++++ .idea/misc.xml | 10 ++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ Dockerfile | 2 +- entrypoint.sh | 7 +++++++ 7 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/docker-backup-duplicity.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100755 entrypoint.sh diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/docker-backup-duplicity.iml b/.idea/docker-backup-duplicity.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/docker-backup-duplicity.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2ca2389 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..60b0c8d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 743cc8f..caaf89a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /var/lib/duplicity ENV HOME="/var/lib/duplicity" # Configure entrypoint and command -ENTRYPOINT ["crond", "-f", "-d", "5"] +ENTRYPOINT ["./entrypoint.sh"] CMD [] # Add image labels diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..574a892 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Running first backup..." +./backup.sh + +echo "Running cron for daily backups..." +crond -f -d 5 -l info