From 931c8711d64b50c240c5cf1079480094dbde9ff1 Mon Sep 17 00:00:00 2001 From: David Runge Date: Tue, 31 Dec 2013 14:19:23 +0100 Subject: Adding new scripts from /usr/local/bin and updating backup-profiles and autostart --- bin/backup-profiles | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 8 deletions(-) mode change 100644 => 100755 bin/backup-profiles (limited to 'bin/backup-profiles') diff --git a/bin/backup-profiles b/bin/backup-profiles old mode 100644 new mode 100755 index 2f87701..66de7af --- a/bin/backup-profiles +++ b/bin/backup-profiles @@ -1,10 +1,47 @@ -#!/bin/bash +#!/bin/sh -cd /tmp -tar cvfz firefox.tgz $1/.mozilla/firefox/david.runge-backup -gpg -e -r 'David Runge ' firefox.tgz -mv -f firefox.tgz.gpg $1/Dropbox/sync +firefoxPID=`ps -C firefox -o pid=` +thunderbirdPID=`ps -C thunderbird -o pid=` + +firefoxTMP=/tmp/firefox.tgz +thunderbirdTMP=/tmp/thunderbird.tgz +firefoxIF=~/.mozilla/firefox/david.runge +thunderbirdIF=~/.thunderbird/dvzrv +OF=~/Dropbox/sync +gpgEND=.gpg + + +if [[ -z "$firefoxPID" ]] +then + echo "Firefox is not running." + echo "Backing up profile." + tar cfPzh $firefoxTMP $firefoxIF + echo "Encrypting profile." + gpg -e -r 'David Runge ' $firefoxTMP + echo "Moving backup to Dropbox." + mv -f $firefoxTMP$gpgEND $OF + echo "Cleaning up." + rm $firefoxTMP + echo "Done." +else + echo "Firefox is still running." + echo "Skipping backup." +fi + +if [[ -z "$thunderbirdPID" ]] +then + echo "Thunderbird is not running." + echo "Backing up profile." + tar cfPz $thunderbirdTMP $thunderbirdIF + echo "Encrypting profile." + gpg -e -r 'David Runge ' $thunderbirdTMP + echo "Moving backup to Dropbox." + mv -f $thunderbirdTMP$gpgEND $OF + echo "Cleaning up." + rm $thunderbirdTMP + echo "Done." +else + echo "Thunderbird is still running." + echo "Skipping backup." +fi -tar cvfz thunderbird.tgz $1/.thunderbird/david.runge -gpg -e -r 'David Runge ' thunderbird.tgz -mv -f thunderbird.tgz.gpg $1/Dropbox/sync -- cgit v1.2.3-70-g09d2