]> git.pond.sub.org Git - empserver/blobdiff - scripts/backup
client: Unbreak standalone build
[empserver] / scripts / backup
index 2c90df76587f9d3375697258e5065c2fd3ef6a7b..9b4ac1c94a611bb17a22a30577d5decf3be009ad 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh -e
 # Backup script to be run from pre_update_hook
-# Written by Markus Armbruster, 2005
+# Written by Markus Armbruster, 2005-2012
 # This script is in the public domain.
 
 # Use: edit configuration variables below to taste, then set
@@ -39,7 +39,7 @@ local_dir=../backup
 # Don't copy (are you *sure* you want to be stupid?):
 remote_host=
 remote_dir=
-remote_email=
+email=
 #
 # Do copy:
 #remote_host=user@host
@@ -52,8 +52,8 @@ remote_email=
 mkdir -p $local_dir
 
 # Tar up the data directory
-tgz=$local_dir/$name.tar.gz
-tar czf $tgz .
+arc=$local_dir/$name.tar.gz
+tar czf $arc .
 
 # Copy the backup to another machine with SSH, in the background
 #
@@ -63,11 +63,11 @@ tar czf $tgz .
 # user's privileges are carefully limited.
 if [ "$remote_host" ]
 then
-    nohup sh -c "scp -qBp '$tgz' '$remote_host:$remote_dir' 2>&1 | mail -e -s 'Empire backup save failed' '$email'" </dev/null >/dev/null 2>&1 &
+    nohup sh -c "scp -qBp '$arc' '$remote_host:$remote_dir' 2>&1 | mailx -s 'Empire backup save failed' '$email'" </dev/null >/dev/null 2>&1 &
 fi
 #
 # A more secure alternative is to replace the scp command by something like
-#    ssh -q -T -o BatchMode=yes -o IdentitiesOnly=yes -i "$HOME/.ssh/empire_id_rsa" $remote_host <"$tgz"
+#    ssh -q -T -o BatchMode=yes -o IdentitiesOnly=yes -i "$HOME/.ssh/empire_id_rsa" $remote_host <"$arc"
 # where $HOME/.ssh/empire_id_rsa contains a private key specifically
 # created for Empire backup, without a passphrase, and authorized_keys
 # on $remote_host contains the matching public key prepended by