Changed day of the month to run peerscrawl.php with a non-default gracetime of 2 months from the 26th to the 25th; translated the script to english

This commit is contained in:
pezcurrel 2024-02-25 08:59:04 +01:00
parent 77d8ab3063
commit f034d57fbc

View file

@ -5,22 +5,22 @@ cd "$basedir/.."
resurrfp=".pcresurrectdone" resurrfp=".pcresurrectdone"
cmdlogfp="peerscrawl.log" cmdlogfp="peerscrawl.log"
logfp="pcloop.log" logfp="pcloop.log"
resdom=26 resdom=25 # day of month when (or after when, if it has not been done already) to execute peerscrawl.php with a gracetime of 2 months
function log { function log {
echo `date "+%Y-%m-%d %H:%M:%S.%N"` "${1}" >> "${logfp}" echo `date "+%Y-%m-%d %H:%M:%S.%N"` "${1}" >> "${logfp}"
} }
while true; do while true; do
dom=$((`date "+%d"`+0)) dom=$((`date "+%d"`+0))
[ $dom -lt $resdom -a -f "$resurrfp" ] && rm "$resurrfp" [ $dom -lt $resdom -a -f "$resurrfp" ] && rm "$resurrfp"
if [[ ($dom -ge $resdom ) && !(-f "$resurrfp") ]]; then # usa un gracetime di 2 mesi if [[ ($dom -ge $resdom ) && !(-f "$resurrfp") ]]; then # use a gracetime of 2 months
touch "$resurrfp" touch "$resurrfp"
log "### Eseguo peerscrawl.php con un gracetime di 2 mesi ###" log "### Starting peerscrawl.php with a 2 months gracetime ###"
./peerscrawl.php -g 2M -e peerscrawl.exclude &> $cmdlogfp ./peerscrawl.php -g 2M -e peerscrawl.exclude &> $cmdlogfp
else # use il gracetime di default else # use the default gracetime
log "### Eseguo peerscrawl.php con il gracetime di default ###" log "### Starting peerscrawl.php with the default gracetime ###"
./peerscrawl.php -e peerscrawl.exclude &> $cmdlogfp ./peerscrawl.php -e peerscrawl.exclude &> $cmdlogfp
fi fi
tail $cmdlogfp >> $logfp tail $cmdlogfp >> $logfp
log "### Fine ###" log "### THE END ###"
done done
exit 0; exit 0;