]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - bin/srsync-incremental
bin/srsync-incremental: fix initial backup
[config/dotfiles.git] / bin / srsync-incremental
index 7fe898aa5d058ff46ac7e03fc97e01f8f585f586..9d800b9cd85b7165069200f0f8b5e776e01551d1 100755 (executable)
@@ -21,7 +21,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -eu
 
 if test "$#" -lt 2; then
     echo "Usage: $0 <backups-directory> <arguments to rsync>" >&2
@@ -31,10 +31,11 @@ if test "$#" -lt 2; then
 fi
 
 
-cd "$1" || exit 1
+cd "$1"
 shift
 
 # Get absolute path to last backup directory.
+dest=./
 for x in backup-*; do
     test -d "$x" || continue
     dest="../$x" # relative to destination directory