aboutsummaryrefslogtreecommitdiffstats
path: root/bin/backup-profiles
diff options
context:
space:
mode:
Diffstat (limited to 'bin/backup-profiles')
-rwxr-xr-xbin/backup-profiles23
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" ]]