From fce842f605cc19b181e4952b38f892f311d1d4fd Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Wed, 27 Apr 2011 16:20:08 +0200 Subject: [PATCH] On some systems /var/lock/ is on tmpfs or will be cleaned otherwise on reboot. So we've to make sure that our subdir in /var/lock is created with approriate permissions before we touch the lockfile. --- hetzner/hetznerbackupv2.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hetzner/hetznerbackupv2.sh b/hetzner/hetznerbackupv2.sh index 7f07a04..cd0e830 100755 --- a/hetzner/hetznerbackupv2.sh +++ b/hetzner/hetznerbackupv2.sh @@ -16,7 +16,8 @@ FTP_USER=uxxx FTP_HOST=uxxx.your-backup.de PROTO=ssh ROOTMAIL="root@localhost" -LOCKFILE="/var/lock/backup/hetznerbackup" +LOCKDIR="/var/lock/backup" +LOCKFILE="$LOCKDIR/hetznerbackup" LOGFILE="/var/log/hetznerbackup" SESSIONLOG=$(mktemp /var/tmp/hetznerbackup.XXXXXXXXX) ERRSTAT=0 @@ -59,6 +60,9 @@ if [ -e $LOCKFILE ]; then echo "This is a typical result of a failed backup run, please contact your admin" exit 5 else + if [ ! -d $LOCKDIR ]; then + mkdir -m 700 $LOCKDIR + fi touch $LOCKFILE fi -- 2.39.2