aboutsummaryrefslogtreecommitdiffstats
path: root/bin/backup-settings
diff options
context:
space:
mode:
Diffstat (limited to 'bin/backup-settings')
-rwxr-xr-xbin/backup-settings19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/backup-settings b/bin/backup-settings
new file mode 100755
index 0000000..1a9cc12
--- /dev/null
+++ b/bin/backup-settings
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+etcTMP=/tmp/etc.tgz
+etcIF=/etc
+OF=/home/dave/ownCloud/backup/settings
+gpgEND=.gpg
+
+echo "Backing up /etc directory."
+tar cfPz $etcTMP $etcIF
+echo "Encrypting compressed directory."
+su - dave -c "gpg -e -r 'David Runge <david.runge@frqrec.com>' $etcTMP"
+echo "Changing permissions on file."
+chown dave:dave $etcTMP$gpgEND
+echo "Moving backup to ownCloud."
+mv -f $etcTMP$gpgEND $OF
+echo "Cleaning up."
+rm $etcTMP
+echo "Done."
+