add error handling of check command
This commit is contained in:
@@ -22,7 +22,11 @@ data:
|
||||
FILES=$(s3cmd ls --no-check-certificate ${BUCKET}/cl01tl/etcd/ |
|
||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}');
|
||||
|
||||
if [ -n "${FILES}" ]; then
|
||||
if [ $? -ne 0 ]; then
|
||||
ERROR=true;
|
||||
echo " ";
|
||||
echo ">> Detected error, will send message to ntfy";
|
||||
elif [ -n "${FILES}" ]; then
|
||||
echo " ";
|
||||
echo ">> Backups to be removed:";
|
||||
echo "$FILES"
|
||||
|
||||
Reference in New Issue
Block a user