--- psinib.pl 2003/10/27 18:58:41 1.18 +++ psinib.pl 2003/10/27 19:07:32 1.19 @@ -249,10 +249,14 @@ if (-l $bl) { $real_bl=readlink($bl) || die "can't read link $bl: $!"; $real_bl="$BACKUP_DEST/$host/$dir/$real_bl" if (substr($real_bl,0,1) ne "/"); - undef $real_bl if (! -e $real_bl); + if (! -e $real_bl) { + xlog($share,"latest link $bl -> $real_bl not valid, removing it"); + unlink $bl || die "can't remove link $bl: $!"; + undef $real_bl; + } } if (! $real_bl) { - xlog($share,"no old backup, trying to find last backup,"); + xlog($share,"no old backup, trying to find last backup"); if (opendir(BL_DIR, "$BACKUP_DEST/$host/$dir")) { my @bl_dirs = sort grep { !/^\./ && -d "$BACKUP_DEST/$host/$dir/$_" } readdir(BL_DIR); closedir(BL_DIR);