Automated encrypted backups to megaupload.

I’ve written a little script to automatically upload a backup of a folder i want, to megaupload.It encrypts the file by using gpg standards, then uploads the file using plowshare. It also creates a filecalled ~/Dropbox/Backup.txt, which stores a record of each and every backup. Including the md5 hash of the encrypted file.Since i have a free account in Megaupload, i store backups for 90 days.. after which it will be dead, but who needs backups older than 90 days right?

Safe, Secure and Easy.

#!/bin/bash
#Written by unhackmunhackmee.wordpress.com

USR=#Username
 PASS=#Pass
 Recipient=me@gmail.com
 Record=~/Dropbox/Backups.txt
 #Set folder to ""; to nullify
 FOLDER="";
 if [ $# -ne "0" ];then FOLDER=$1;
 else
 if [ -z $FOLDER ];then
 echo ERROR! No input files! && exit;
 fi
 fi

DATE=`date +%d%m%y-%H%M`
 gpg-zip --recipient $Recipient --encrypt --output /tmp/$DATE.pgp $FOLDER
 MeURL=`plowup -a $USR:$PASS /tmp/$DATE.pgp megaupload`
 MD5=`md5sum /tmp/$DATE.pgp`
 echo -e "$MD5\t$MeURL\t`date +%D-%H:%M`\t$FOLDER" >> $Record
 echo >> $Record

im thinking of adding this to the cron tab, but the thing has to be run as a normal user,
(doesn’t need root powers)- i haven’t done so because gnome & unity- both seem too oft to
crash on me.btw, you need plowshare and gpg installed, and the recipient’s key should be trusted, or gpg prompts to warn you.

Advertisements

About unhackmee

typical teenager rumbling about everything not worth your time... Mostly about things that would waste precious seconds from your life, stolen- and never to be returned. WARNING: Discontinue use and seek immediate medical attention should rashes or itchiness occur.

Posted on April 9, 2011, in Internet Tricks, Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: