Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 123528 - [patch] run-crons does not run weekly and monthly jobs because 'find' fails
Summary: [patch] run-crons does not run weekly and monthly jobs because 'find' fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Cron Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 169449
  Show dependency tree
 
Reported: 2006-02-20 13:04 UTC by Martin Scharrer
Modified: 2009-04-13 19:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for /usr/sbin/run-crons to delete correctly 'weekly' and 'monthly' lockfiles (run-crons.patch,711 bytes, patch)
2006-02-20 13:08 UTC, Martin Scharrer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Scharrer 2006-02-20 13:04:06 UTC
I detected that vixie-cron (4.1-r8) does not run weekly and monthly cron jobs.
The reason is that the 'find' call to delete old 'lastrun'-files fails for this two but not for hourly and daily jobs, because of the used \( \) in the TIME variable.

For some reason the following is not working (find says: "paths must precede expression", Usage: ...):
TIME="\( -cmin +44645 -or -mmin +44645 \)"
[...]
find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; &>/dev/null || true

If I substitude the content of TIME manually inside a shell:
find ${LOCKDIR} -name cron.$BASE \( -cmin +44645 -or -mmin +44645 \) -exec rm {} \; &>/dev/null || true
then it's working correctly (with LOCKDIR and BASE set, of course).

The \( \) are the issue (there are not present for 'hourly' and 'daily').
If there are outside the variable then it's working for all four cases:

TIME="-cmin +44645 -or -mmin +44645"
[...]
find ${LOCKDIR} -name cron.$BASE \( $TIME \) -exec rm {} \; &>/dev/null || true

I tried to figure out this issue (maybe a problem with the shell expansion) but I didn't found anything.

I will append a small patch.
Comment 1 Martin Scharrer 2006-02-20 13:08:58 UTC
Created attachment 80304 [details, diff]
Fix for /usr/sbin/run-crons to delete correctly 'weekly' and 'monthly' lockfiles
Comment 2 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2008-10-06 14:03:42 UTC
i am not sure i have seen this bug. anybody on cron-bugs able to reproduce it?

the patch looks harmless though...
Comment 3 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-04-13 19:47:40 UTC
the current run-crons doesnt expose this bug anymore.
>>>>>>
                hourly)
                        #>= 1 hour, 5 min -=> +65 min
                        TIME="-cmin +65" ;;
                daily)
                        #>= 1 day, 5 min -=> +1445 min
                        TIME="-cmin +1445"  ;;
                weekly)
                        #>= 1 week, 5 min -=> +10085 min
                        TIME="-cmin +10085"  ;;
                monthly)
                        #>= 31 days, 5 min -=> +44645 min
                        TIME="-cmin +44645" ;;
<<<<<<
please reopen if i am mistaken.

thanks.