fix script day and week

This commit is contained in:
Valentin CZERYBA 2023-01-23 23:45:51 +01:00
parent 5dca6fbdc9
commit 8ed95bc32b
2 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,10 @@ DAY=$(date +%u)
if [ ${DAY} -eq 1 ]; then
if [ ${WEEK} -ne "01" ]; then
WEEK=$(echo "$WEEK-1" |bc)
if [ ${#WEEK} -eq 1 ]; then
WEEK="0${WEEK}"
fi
else
WEEK="53"
fi

View File

@ -10,6 +10,9 @@ DAY=$(date +%u)
if [ ${DAY} -eq 1 ]; then
if [ ${WEEK} -ne "01" ]; then
WEEK=$(echo "$WEEK-1" |bc)
if [ ${#WEEK} -eq 1 ]; then
WEEK="0${WEEK}"
fi
else
WEEK="53"
fi
@ -33,6 +36,6 @@ do
cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL}
echo "----------------" >> ${MAIL}
done
cat ${MAIL} |mail -s "Rapport reverse proxy $DATE" valczebackup@gmail.com
cat ${MAIL} |mail -s "Rapport hebdomadaire reverse proxy $DATE" valczebackup@gmail.com
#rm $directory_host/*
done