Aether/aether-gen.bash

30 lines
703 B
Bash
Raw Normal View History

#!/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>
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.