gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] 01/04: move backup to script


From: gnunet
Subject: [taler-deployment] 01/04: move backup to script
Date: Wed, 26 Oct 2022 17:05:14 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository deployment.

commit e86369d56c26f164f53619d97a0c7cdff19ec173
Author: MS <ms@taler.net>
AuthorDate: Wed Oct 26 14:02:08 2022 +0200

    move backup to script
---
 docker/hybrid/README    | 16 ++++------------
 docker/hybrid/backup.sh | 24 ++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/docker/hybrid/README b/docker/hybrid/README
index 77da82c..8621947 100644
--- a/docker/hybrid/README
+++ b/docker/hybrid/README
@@ -50,18 +50,10 @@ for an example.
 Volumes
 -------
 
-Data is kept into Docker volumes.  Run the following command to
-export database, key material, and logs:
-
-$ docker run \
-  -v /tmp:/tmp \
-  -v hybrid_talerdata:/taler-data \
-  -v hybrid_talerlogs:/taler-logs \
-  -it debian:stable \
-  /bin/bash -c "tar --no-same-owner --no-same-permissions -c -f 
/tmp/backup.tar /taler-data /taler-logs"
-
-If it succeeded, the file "/tmp/backup.tar" on the host system
-should now contain the data coming from the volumes.
+Data is kept into Docker volumes.  From this directory,
+run the following command to export database, key material, and logs:
+
+  $ ./backup.sh
 
 Run
 ---
diff --git a/docker/hybrid/backup.sh b/docker/hybrid/backup.sh
new file mode 100755
index 0000000..03d5119
--- /dev/null
+++ b/docker/hybrid/backup.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -eu
+
+if ! which docker > /dev/null; then
+  echo docker not found.
+  exit 1
+fi
+
+if ! docker images | grep debian | grep stable > /dev/null; then
+  echo debian:stable not found.  Please extract backup with custom image.
+  exit 2
+fi
+
+BACKUP_FILE="/tmp/$(date +%Y-%m-%d)-taler-backup.tar"
+
+docker run \
+  -v /tmp:/tmp \
+  -v hybrid_talerdata:/taler-data \
+  -v hybrid_talerlogs:/taler-logs \
+  -it debian:stable \
+  /bin/bash -c "tar --no-same-owner --no-same-permissions -c -f ${BACKUP_FILE} 
/taler-data /taler-logs && chown $(id --user):$(id --group) ${BACKUP_FILE}" > 
/dev/null
+
+echo Backup at: ${BACKUP_FILE}

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]