aboutsummaryrefslogtreecommitdiffstats
path: root/bin/backup-profiles
blob: 66de7af0f9acefdd287cf26f917b2e7d5af7aad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

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 <david.runge@frqrec.com>' $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 <david.runge@frqrec.com>' $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