Aether/aether-gen.bash

39 lines
849 B
Bash
Executable File

#!/bin/bash
# File: aether-gen.bash
#
# Description: This file generates the backup in an encrypted format.
#
# Package: AniNIX/HelloWorld
# Copyright: WTFPL
#
# Author: DarkFeather <ircs://aninix.net:6697/DarkFeather>
#
# Helptext
if [ "$1" == "-h" ]; then
cat <<EOM
Usage: $0 # Generate teh backup from /usr/local/etc/Aether/backup-entries
EOM
exit 0
fi
export BACKUPDIR="/usr/local/backup"
export BACKUPCMD="rsync -avzl --delete-after";
chown root:root "$BACKUPDIR"
chmod 0770 "$BACKUPDIR"
for i in `find /usr/local/etc/Aether/backup-entries/ -type f`; do
bash "${i}"
done
date > "$BACKUPDIR"/lastbackup.date
cd /home/aether
echo Creating and encrypting archive...
tar cvzf - /usr/local/backup | openssl enc -aes256 -pass file:/usr/local/etc/Aether/pass.txt -in aether.tar.gz -out aether.enc
echo Created aether archive.