check-blacklist.sh: Fix potential false positive
[mgsautils.git] / fs / backup_full.sh
old mode 100644 (file)
new mode 100755 (executable)
index 404b5e3..18e5f3a
@@ -1,4 +1,21 @@
-# PLACEHOLDER FILE!
-# This script is not yet ready for publication, as it contains environment-specific and/or hard-coded sensitive data.
-# This file is here to annoy myself to make an update.
-#      ~ MegaBrutal
+#!/bin/sh
+. $1
+FILENAME=${FULLNAME}${APPEND}
+cd ${STORAGE}
+if [ "${CLEAN_DIR}" = "true" ]; then rm *; fi
+dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} -zbzip2:9 -an --exclude-from-file ${EXCLUDE}
+
+case $(uname) in
+       Linux)  md5sum -b ${FILENAME}* > ${FILENAME}.md5;;
+       *BSD)   md5 -r ${FILENAME}* > ${FILENAME}.md5;;
+esac
+chown ${XFER_USER} ${FILENAME}.md5
+
+case "${XFER_METHOD}" in
+       scp)
+               su - ${XFER_USER} -c "scp -p ${STORAGE}${FILENAME}* ${XFER_TARGET}"
+               ;;
+       rsync)
+               su - ${XFER_USER} -c "rsync -auv ${STORAGE} ${XFER_TARGET}"
+               ;;
+esac