On Tue, Oct 01, 2024 at 12:45:13AM +0200, Thorsten Glaser wrote:
> Package: popularity-contest
> Version: 1.76
> Severity: normal
> X-Debbugs-Cc: t...@mirbsd.de
> 
> -rw-r--r-- 1 root     root      21239 Sep 26 11:06 popularity-contest
> -rw-r--r-- 1 root     root      21260 Sep 26 06:25 popularity-contest.0
> -rw-r--r-- 1 root     root       4875 Sep 19 11:06 popularity-contest.1.gz
> -rw-r--r-- 1 root     root       4883 Sep 19 06:25 popularity-contest.2.gz
> -rw-r--r-- 1 root     root       4864 Sep 12 11:06 popularity-contest.3.gz
> -rw-r--r-- 1 root     root       4893 Sep 12 06:25 popularity-contest.4.gz
> -rw-r--r-- 1 root     root       4878 Sep  5 11:06 popularity-contest.5.gz
> -rw-r--r-- 1 root     root       4871 Sep  5 06:25 popularity-contest.6.gz

This is more or less intended... 
There are two cron jobs, one weekly and one daily.
The weekly run predictably when the sysadmin has configured daily cronjob
to run (6:25 by default).
The daily run actually at a random time of the week.

Normally if the daily succeed, then the weekly is skipped, but there
is a tolerance if the daily is more than 6.5 days old, then the
weekly is run anyway, so yes it will run twice in that case.

You can check the detail in /etc/cron.daily/popularity-contest:

if [ "$MODE" != "--crond" ]  || ( [ "$DAY" ] && [ "$DAY" != "$(date +%w)" ] ) ; 
then
        # Ensure that popcon runs at least once in the last week
        if [ -f "$POPCONOLD" ] ; then
                now=$(date +%s)
                lastrun=$(last_sub)
                if [ "$MODE" = "--crond" ]; then
                        # 7.5 days, in seconds
                        week=648000
                else
                        # 6.5 days, in seconds
                        week=561600
                fi
                if [ "$(( $now - $lastrun ))" -le "$week" ]; then
                        exit 0
                fi
        fi
fi

Cheers,
Bill

Reply via email to