Added ls-fail check

This commit is contained in:
Pavel Dmitriev 2021-12-16 17:45:09 +03:00 committed by GitHub
parent e448a85db6
commit 5271dbbaeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -6,7 +6,16 @@ DIRECTORY=`dirname "$ABSOLUTE_FILENAME"`
source ${DIRECTORY}/config
currStamp=`date +%s`
for backup_dir in `ls -d ${prefix}/backup-*`
list=`ls -d ${prefix}/backup-*`
if [ "$?" != 0 ]
then
echo "FAIL - Directory listnig failed!"
exit
fi
for backup_dir in ${list}
do
echo Directory ${backup_dir}:
lastFull=`cd ${backup_dir}/ && ls -t *-[F].t* 2>/dev/null | head -n 1`