diff options
author | David Runge <david.runge@frqrec.com> | 2014-01-19 02:26:54 +0100 |
---|---|---|
committer | David Runge <david.runge@frqrec.com> | 2014-01-19 02:26:54 +0100 |
commit | 79a200cbb460d69b58f025da70b0e3753a227a5e (patch) | |
tree | dea1c3f7bca7b2947cb1c9ea336a2f1b116b97a9 /bin | |
parent | a41678525125c951ca02b3eedf640671e1309b82 (diff) | |
download | dotfiles-79a200cbb460d69b58f025da70b0e3753a227a5e.tar.gz dotfiles-79a200cbb460d69b58f025da70b0e3753a227a5e.tar.bz2 dotfiles-79a200cbb460d69b58f025da70b0e3753a227a5e.tar.xz dotfiles-79a200cbb460d69b58f025da70b0e3753a227a5e.zip |
Added support for backing up, while psd is running
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/backup-profiles | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/bin/backup-profiles b/bin/backup-profiles index 5ee9b3c..57a7d03 100755 --- a/bin/backup-profiles +++ b/bin/backup-profiles @@ -5,8 +5,10 @@ thunderbirdPID=`ps -C thunderbird -o pid=` firefoxTMP=/tmp/firefox.tgz thunderbirdTMP=/tmp/thunderbird.tgz -firefoxIF=~/.mozilla/firefox/dvzrv -thunderbirdIF=~/.thunderbird/dvzrv +firefoxIF=~/.mozilla/firefox/ +thunderbirdIF=~/.thunderbird/ +profileName=dvzrv +backupEND=-backup OF=~/Dropbox/sync gpgEND=.gpg @@ -15,7 +17,7 @@ if [[ -z "$firefoxPID" ]] then echo "Firefox is not running." echo "Backing up profile." - tar cfPzh $firefoxTMP $firefoxIF + tar cfPzh $firefoxTMP -C $firefoxIF $profileName echo "Encrypting profile." gpg -e -r 'David Runge <david.runge@frqrec.com>' $firefoxTMP echo "Moving backup to Dropbox." @@ -25,7 +27,20 @@ then echo "Done." else echo "Firefox is still running." - echo "Skipping backup." + psdStopped=`systemctl status |grep inactive` + if [[ ! -z "$psdStopped" ]]; then + echo "psd service running. Trying to use its backup." + tar cfPzh $firefoxTMP -C $firefoxIF "$profileName$backupEND" + echo "Encrypting profile." + gpg -e -r 'David Runge <david.runge@frqrec.com>' $firefoxTMP + echo "Moving backup to Dropbox." + mv -f $firefoxTMP$gpgEND $OF + echo "Cleaning up." + rm $firefoxTMP + echo "Done." + else + echo "Skipping backup." + fi fi if [[ -z "$thunderbirdPID" ]] |