Bug 1538603 - default backup-manager cron job problem with commented copies of configuration file lines
Summary: default backup-manager cron job problem with commented copies of configuratio...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: backup-manager
Version: epel7
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-25 12:20 UTC by Boschkundendienst
Modified: 2024-07-09 02:16 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-09 02:16:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Boschkundendienst 2018-01-25 12:20:19 UTC
Description of problem:
backup-manager installs the following script as cron job

/etc/cron.daily/backup-manager.cron

which is executed daily. This script evaluates the variable BM_DAILY_CRON from /etc/backup-manager.conf

If /etc/backup-manager.conf contains multiple lines that contain the string 'BM_DAILY_CRON' (eg. you created a copy of a configuration line and commented it out by preceding it with '#') the grep command in the above script will pickup both matching lines and when it tries to evaluate the variable from the output of the grep command it fails. This causes backup-manager not to run daily as expected.


Version-Release number of selected component (if applicable):
0.7.10 13.el7

How reproducible:
always

Steps to Reproduce:
1. install backup-manager from epel.
2. open the file /etc/backup-manager.conf with your favourite editor and change the lines

   # RPM-specific : Enabled daily cron
   export BM_DAILY_CRON="false"

to

   # RPM-specific : Enabled daily cron
   #export BM_DAILY_CRON="false"
   export BM_DAILY_CRON="true"

Your backup will never run because the evaluation of the variable BM_DAILY_CRON will fail due to grep is finding 2 matching lines.

Actual results:
/etc/cron.daily/backup-manager.cron: line 10: [: =: unary operator expected
[backup-manager] Daily cron is disabled

Expected results:
  ${BM_PATH} -v
should be executed which is usually
  /usr/sbin/backup-manager -v

Additional info:
The problem can be solved by changing the line

  eval $(grep BM_DAILY_CRON /etc/backup-manager.conf)

in /etc/cron.daily/backup-manager.cron

to

  eval $(grep BM_DAILY_CRON /etc/backup-manager.conf | grep -v ^#)

or use a regex that ignores comment lines to evaluate the variable.

Comment 1 Fedora Admin user for bugzilla script actions 2022-11-28 12:09:11 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 2 Troy Dawson 2024-07-09 02:16:39 UTC
EPEL 7 entered end-of-life (EOL) status on 2024-06-30.\n\nEPEL 7 is no longer maintained, which means that it\nwill not receive any further security or bug fix updates.\n As a result we are closing this bug.


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