1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Add backup script

This commit is contained in:
Starbeamrainbowlabs 2016-05-24 19:46:53 +01:00
parent 5fc64445bb
commit 67095c9a45
2 changed files with 26 additions and 0 deletions

View file

@ -25,6 +25,7 @@ Here's a list of the most interesting ones, along with what they do and where th
- [xidel](http://www.videlibri.de/xidel.html) - A (what looks like) a brilliant html extraction tool. Supports various selector languages.
- [micro](https://github.com/zyedidia/micro) - A new (experimental) terminal-based text editor.
- [tig](http://jonas.nitro.dk/tig/) - A terminal-based git repository browser.
- backup - A script I wrote to make using Duplicity easier.
## Disclaimer
I don't own many of the tools in this repository. If you are an owner of one of these tools and I haven't linked to you, please let me know as I probably forgot.

25
backup Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
if [[ -z "$1" ]]
then
echo Error: Not settings file specified!
exit
fi
. "$1"
echo "Backing up to ${BACKUP_DIRECTORY}."
if [[ ! -w "${BACKUP_DIRECTORY}" ]]
then
notify-send --icon "deja-dup" "Backup Cancelled" "The target directory is not currently available."
exit
fi
env PASSPHRASE=${PASSWORD} SIGN_PASSPHRASE=${PASSWORD} duplicity --encrypt-sign-key ${ENCRYPTION_KEY} "${SOURCE_DIRECTORY}" "${BACKUP_SOURCE_PREFIX}${BACKUP_DIRECTORY}"
notify-send --icon "deja-dup" "Backup Complete" "Riftgate was backed up to Data Shape successfully."
# Delete old backups
#duplicity remove-all-but-n-full 3 --force ${BACKUP_DIRECTORY}