X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=backup.sh;h=ae4067859d755df691d2ac4747caadc871420a0e;hb=255cc8f7d17aeb999055bf42675d8786681c9378;hp=8f85b1445751dc76d535ee8b254a26f32d7370ff;hpb=2c809fb51f8723ee4499c48dcf81939f39e7e4c9;p=backup.sh diff --git a/backup.sh b/backup.sh index 8f85b14..ae40678 100755 --- a/backup.sh +++ b/backup.sh @@ -25,10 +25,14 @@ # # The script is halfway Norwegian and halfway English. Newer modifications are # in English, we should probably stick to that. - -# TODO(sesse, 2007-12-16): -# * Sjekk hvorfor .idx-filene til UD er blitt 0 for siste fullbackuper -# * Rydde uleselig kode fra linje 211 og litt nedover +# +# Known issues: +# +# o $R has no proper meaning because of the forking subshell stuff. We need a +# more robust way of returning non-zero on errors, which we probably don't +# right now. +# o The code around line 211 and downwards is messy. +# # Configuration LOCKFILE=/home/backup/backuprun.lockfile @@ -59,11 +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 #syntax of remotestat: #hostname:/directory/ @@ -143,7 +148,7 @@ backup() echo $DATEs > ../.date && touch -t $DATE ../.date # Make a sorted filelist as well - sort -k6 < $DATE.sdx > $DATE.sdx + sort -k6 < $DATE.idx > $DATE.sdx # Fix permissions chmod 600 *tgz #only for us