refactor logging
This commit is contained in:
@@ -19,13 +19,13 @@ data:
|
|||||||
echo " ";
|
echo " ";
|
||||||
echo ">> Configured Date Range is $(date -u -d @${DATE_RANGE_SECONDS} +"%j days, %H hours, %M minutes")";
|
echo ">> Configured Date Range is $(date -u -d @${DATE_RANGE_SECONDS} +"%j days, %H hours, %M minutes")";
|
||||||
echo ">> Backups prior to '$DATE_RANGE' will be removed";
|
echo ">> Backups prior to '$DATE_RANGE' will be removed";
|
||||||
echo " ";
|
FILES=$(s3cmd ls --no-check-certificate ${BUCKET}/cl01tl/etcd/ |
|
||||||
echo ">> Backups to be removed:";
|
|
||||||
$FILES=$(s3cmd ls --no-check-certificate ${BUCKET}/cl01tl/etcd/ |
|
|
||||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}');
|
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}');
|
||||||
echo "$FILES"
|
|
||||||
|
|
||||||
if [ -n "${FILES}" ]; then
|
if [ -n "${FILES}" ]; then
|
||||||
|
echo " ";
|
||||||
|
echo ">> Backups to be removed:";
|
||||||
|
echo "$FILES"
|
||||||
echo " ";
|
echo " ";
|
||||||
echo ">> Deleting ...";
|
echo ">> Deleting ...";
|
||||||
$FILES | while read file; do
|
$FILES | while read file; do
|
||||||
@@ -35,6 +35,9 @@ data:
|
|||||||
echo ">> Detected error, will send message to ntfy";
|
echo ">> Detected error, will send message to ntfy";
|
||||||
fi;
|
fi;
|
||||||
done;
|
done;
|
||||||
|
else
|
||||||
|
echo " ";
|
||||||
|
echo ">> No backups remove";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ "$ERROR" = "true" ]; then
|
if [ "$ERROR" = "true" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user