Changing logrotate-cronjob-frequency config adds new frequency instead of replacing the old one

Bug #2017795 reported by Tianqi Xiao
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
logrotate-charm
Fix Released
Medium
Mert Kirpici

Bug Description

The currently implementation doesn't delete the script file from the previous cron folder when `logrotate-cronjob-frequency` gets updated. Here is an example workflow:

1. set `logrotate-cronjob-frequency` to `hourly`
2. charm-logrorated script gets added to `/etc/cron.hourly`
3. set `logrotate-cronjob-frequency` to `daily`
4. charm-logrorated script gets added to `/etc/cron.daily` but the script in `/etc/cron.hourly` also remains.

The result of this example workflow is running the cronjob in both hourly and daily frequency, which is not the expected behavior.

Tags: bseng-1137

Related branches

Tianqi Xiao (txiao)
summary: - Changing logrotate-cronjob-frequency doesn't remove old script
+ Changing logrotate-cronjob-frequency config adds new frequency instead
+ of replacing the old one
tags: added: bseng-1137
Changed in charm-logrotated:
status: New → Triaged
Tianqi Xiao (txiao)
Changed in charm-logrotated:
status: Triaged → New
Eric Chen (eric-chen)
Changed in charm-logrotated:
importance: Undecided → Medium
status: New → Triaged
Changed in charm-logrotated:
assignee: nobody → Mert Kirpici (mertkirpici)
status: Triaged → In Progress
Changed in charm-logrotated:
status: In Progress → Fix Committed
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
milestone: none → 23.07
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.