aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-01-19 14:23:29 +0100
committerDavid Runge <david.runge@frqrec.com>2014-01-19 14:23:29 +0100
commit5cb711e02f8df8639abbd462c91e97b8320531a0 (patch)
tree44b00f11aecc746bec6b4d12fb2ae5c4288c94cc /bin
parent1f715e04f84e4bafbb0073599dd4e217052450d5 (diff)
downloaddotfiles-5cb711e02f8df8639abbd462c91e97b8320531a0.tar.gz
dotfiles-5cb711e02f8df8639abbd462c91e97b8320531a0.tar.bz2
dotfiles-5cb711e02f8df8639abbd462c91e97b8320531a0.tar.xz
dotfiles-5cb711e02f8df8639abbd462c91e97b8320531a0.zip
Made the script tar only the profile directory. More comments and check for psd service.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/backup-profiles21
1 files changed, 12 insertions, 9 deletions
diff --git a/bin/backup-profiles b/bin/backup-profiles
index 57a7d03..db3dc66 100755
--- a/bin/backup-profiles
+++ b/bin/backup-profiles
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# Backup profiles of firefox and thunderbird to local Dropbox (or other location) while encrypting them using gpg
+#
firefoxPID=`ps -C firefox -o pid=`
thunderbirdPID=`ps -C thunderbird -o pid=`
@@ -15,8 +18,8 @@ gpgEND=.gpg
if [[ -z "$firefoxPID" ]]
then
- echo "Firefox is not running."
- echo "Backing up profile."
+ echo "Firefox is not running."
+ echo "Backing up profile."
tar cfPzh $firefoxTMP -C $firefoxIF $profileName
echo "Encrypting profile."
gpg -e -r 'David Runge <david.runge@frqrec.com>' $firefoxTMP
@@ -26,11 +29,11 @@ then
rm $firefoxTMP
echo "Done."
else
- echo "Firefox is still running."
- psdStopped=`systemctl status |grep inactive`
+ echo "Firefox is still running."
+ psdStopped=`systemctl status psd |grep inactive`
if [[ ! -z "$psdStopped" ]]; then
echo "psd service running. Trying to use its backup."
- tar cfPzh $firefoxTMP -C $firefoxIF "$profileName$backupEND"
+ 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."
@@ -45,9 +48,9 @@ fi
if [[ -z "$thunderbirdPID" ]]
then
- echo "Thunderbird is not running."
- echo "Backing up profile."
- tar cfPz $thunderbirdTMP $thunderbirdIF
+ echo "Thunderbird is not running."
+ echo "Backing up profile."
+ tar cfPz $thunderbirdTMP -C $thunderbirdIF $profileName
echo "Encrypting profile."
gpg -e -r 'David Runge <david.runge@frqrec.com>' $thunderbirdTMP
echo "Moving backup to Dropbox."
@@ -56,7 +59,7 @@ then
rm $thunderbirdTMP
echo "Done."
else
- echo "Thunderbird is still running."
+ echo "Thunderbird is still running."
echo "Skipping backup."
fi