]> git.sesse.net Git - backup.sh/commitdiff
PID in lockfile, also prints when exists before run.
authorroot <empty>
Thu, 14 Feb 2008 13:12:04 +0000 (13:12 +0000)
committerroot <empty>
Thu, 14 Feb 2008 13:12:04 +0000 (13:12 +0000)
backup.sh

index 18968c8202ab309afc8a7f5f0567b8bffe477dfa..ae4067859d755df691d2ac4747caadc871420a0e 100755 (executable)
--- a/backup.sh
+++ b/backup.sh
@@ -63,12 +63,12 @@ trap die SIGINT SIGTERM
 
 # Don't start if we're already running
 if [ -e $LOCKFILE ]; then
-       echo `date`": $LOCKFILE exists, exiting."
-       echo `date`": $LOCKFILE exists, exiting." >&2
+       echo `date`": $LOCKFILE exists for pid `cat $LOCKFILE`, exiting."
+       echo `date`": $LOCKFILE exists for pid `cat $LOCKFILE`, exiting." >&2
        exit 1
 fi;
 touch $LOCKFILE
-echo "$$" > $LOCKFILE
+echo $$ > $LOCKFILE
 
 #syntax of remotestat:
 #hostname:/directory/