Bug 488916 - 0anacron unary operator expected
0anacron unary operator expected
Product: Fedora
Classification: Fedora
Component: anacron (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Marcela Mašláňová
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-03-06 02:42 EST by Allen Kistler
Modified: 2009-03-06 03:27 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-06 03:27:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Allen Kistler 2009-03-06 02:42:03 EST
Description of problem:
There's a syntax error in /etc/cron.hourly/0anacron that causes the script to only send an email with the subject error in it.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. make sure anacron and cronie are installed
2. read mail at the top of every hour
Actual results:
/etc/cron.hourly/0anacron: line 3: [: 20090306: unary operator expected

(The date varies, of course.)

Expected results:
No email.  The script should run without generating a syntax error message.

Additional info:
This bug was reported as Bug 486156 (closed as a duplicate of Bug 252254) and resolved as part of Bug 252254 as "Fixed in anacron-2.3-70," but it isn't resolved as of anacron-2.3-71.fc11.

The suggested patch from Bug 252254 was:

--- 0anacron.orig       2009-02-10 03:00:15.000000000 -0700
+++ 0anacron    2009-02-16 08:53:55.000000000 -0700
@@ -1,6 +1,6 @@
 day=`cat /var/spool/anacron/cron.daily`
-if [ `date +%Y%m%d` = $day ]; then
+if [ `date +%Y%m%d` = "$day" ]; then
     exit 0;
Comment 1 Marcela Mašláňová 2009-03-06 03:20:59 EST
Ok, this somehow didn't go to cvs. This should be fixed in anacron-2.3-72. (I check the file after build for be 100% sure).
Comment 2 Marcela Mašláňová 2009-03-06 03:27:49 EST
Please feel free to reopen it, if there will be any other troubles.

Note You need to log in before you can comment on or make changes to this bug.