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 [ ${DAY} -eq 1 ]; then
if [ ${WEEK} -ne "01" ]; then if [ ${WEEK} -ne "01" ]; then
WEEK=$(echo "$WEEK-1" |bc) WEEK=$(echo "$WEEK-1" |bc)
if [ ${#WEEK} -eq 1 ]; then
WEEK="0${WEEK}"
fi
else else
WEEK="53" WEEK="53"
fi fi

View File

@ -10,6 +10,9 @@ DAY=$(date +%u)
if [ ${DAY} -eq 1 ]; then if [ ${DAY} -eq 1 ]; then
if [ ${WEEK} -ne "01" ]; then if [ ${WEEK} -ne "01" ]; then
WEEK=$(echo "$WEEK-1" |bc) WEEK=$(echo "$WEEK-1" |bc)
if [ ${#WEEK} -eq 1 ]; then
WEEK="0${WEEK}"
fi
else else
WEEK="53" WEEK="53"
fi fi
@ -33,6 +36,6 @@ do
cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL} cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL}
echo "----------------" >> ${MAIL} echo "----------------" >> ${MAIL}
done 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/* #rm $directory_host/*
done done