I quickly modified and packaged a pure Python implementation of the
rsync algorithm today. It’s on Github and PyPi. It’s going to be used in
the open-source, symmetrically-encrypted, bandwidth-efficient,
cross-platform backup software that I’m writing. Because why, for fuck’s
sake, would you trust *all the files* on your computer, plus your
cryptographic scheme, and potentially, […]
I made a bash shell script to automate encrypted (remote or local) data
backups with Duplicity. Duplicity
uses asymmetric OpenPGP RSA keys to
encrypt a tarballs of specified files to be backed up, and it also
supports incremental backups. So, after making a full backup, it is more
efficient do to the fact that it only saves changes made to files and
not entirely new copies of files. Duplicity also supports versioning,
i.e. you can say “give me File A from 3 days ago”.
Duplicity is not efficient in it’s cryptographic design, as my friend
Tom wisely pointed out, in that use of asymmetric cryptographic
algorithms is heavily intensive upon processor resources, and it would
be better to replace this feature with something more along the lines of
the algorithms (e.g. AES, Serpent, and Twofish) and read/write speed
testing features which TrueCrypt supports,
for example.
This script depends on both curl and a newer version of duplicity (which
is not yet included in the standard repositories), so to install those
dependencies in Debian-based distros do:
#!/bin/bash
# _____________________
#| BACKUP[your].SH[it] |
#|---------------------|
#|v.0.1.2 |\ ^ /^
#|Written by | \ / \ // \
#|Isis Lovecruft | \ |\___/| / \// .\
#|isis@patternsinthe | \ /O O \__ / // | \ \ *----*
#| void.net| / / \/_/ // | \ \ \ |
#|_____________________| @___@` \/_ // | \ \ \/\ \
# 0/0/| \/_ // | \ \ \ \
# 0/0/0/0/| \/// | \ \ | |
# 0/0/0/0/0/_|_ / ( // | \ _\ | /
# 0/0/0/0/0/0/`/,_ _ _/ ) ; -. | _ _\.-~ / /
# ,-} _ *-.|.-~-. .~ ~
# \ \__/ `/\ / ~-. _ .-~ /
# \____(oo) *. } { /
# ( (--) .----~-.\ \-` .~
# //__\\ \__ zomg! ///.----..< \ _ -~
# // \\ ///-._ _ _ _ _ _ _{^ - - - - ~
#
# Backup script to automate SSH, SCP, SFTP, FTP, and IMAP backups through
# Duplicity. Duplicity encrypts backup files through GPG before sending
# files through protocol. This script runs a check on the available
# bandwidth, and only runs the backup when the bandwidth available is
# above a configurable threshhold.
#
# This is going to be rewritten using duplicati instead of duplicity in the
# next major version release.
SPEED=$(curl -w %{speed_download} -o /dev/null -s http://speedtest.sea01.softlayer.com/speedtest/speedtest/random1000x1000.jpg)
INT=${SPEED/\.*}
KBPS=$(echo $[INT / 1024])
THRESHOLD="200"
# Uncomment and set the following in order to not type your password.
# This is incredibly insecure, as your password is then stored
# plaintext.
#export PASSPHRASE='passphrase'
# The $SPEED variable downloads a nice image of snow (into /dev/null so that
# it isn't actually saved anywhere on disk). It also gives us a write-out
# (-w %{speed_download}) for the average available bandwidth (incoming) in
# bytes per second.
#
# $INT turns the float $SPEED into an integer.
#
# $KBPS, as I'm sure you can surmise, turns the bytes per second into
# kilobytes per second.
#
# $THRESHOLD can be changed to fit the user's preferences, and it defines
# the minimum bandwidth which should be available for a duplicity backup to
# take place.
if [[ "$#" == "0" ]]; then
echo ""
echo "Usage: ./backup.sh ... "
echo ""
echo "Backup locations can be locally stored on the same …