X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=rsync-luks.sh;fp=rsync-luks.sh;h=87daf192cbae0327cb000e4c4f005c3c6cecd9ed;hb=71bcbb9518bc6512f6ff22c0aa8fc04b2e921a52;hp=0000000000000000000000000000000000000000;hpb=d26b38afff52ff3b13303962bda478884696e0f0;p=scripts.git
diff --git a/rsync-luks.sh b/rsync-luks.sh
new file mode 100755
index 0000000..87daf19
--- /dev/null
+++ b/rsync-luks.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+#########################################################################
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the version 3 of the GNU General Public License #
+# as published by the Free Software Foundation. #
+# #
+# This program is distributed in the hope that it will be useful, but #
+# WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see . #
+# #
+# Written by and Copyright (C) Francois Fleuret #
+# Contact for comments & bug reports #
+#########################################################################
+
+# This script takes two filenames as arguments, mounts them as luks
+# volumes, and synchronizes their contents.
+
+# IT CHANGES THE CONTENT OF THE SECOND ARGUMENT
+
+set -e
+set -o pipefail
+
+if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
+ cat <
+
+Mounts both files as LUKS volume and rsync the source to the dest. It
+first performs a dry-run and then asks for interactive confirmation
+before synchronizing for real.
+
+Comments and bug reports to francois@fleuret.org
+
+EOF
+ exit 0
+fi
+
+[ -f "$1" ] && [ -f "$2" ] || (echo "$0