Bug 1615015 - [RFE] Do not backup tasks by default when cleaning up tasks from the database
Summary: [RFE] Do not backup tasks by default when cleaning up tasks from the database
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.3.2
Hardware: x86_64
OS: Linux
high
medium with 1 vote
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-11 10:25 UTC by Kenny Tordeurs
Modified: 2024-03-25 15:06 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:08:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24588 0 Normal New Automatic pruning for foreman-plugin-tasks-automatic-cleanup 2021-02-08 18:36:28 UTC
Foreman Issue Tracker 32175 0 Normal Closed By default, do not backup tasks when cleaning them up 2021-06-07 12:10:58 UTC
Red Hat Knowledge Base (Solution) 3558991 0 None None None 2018-10-09 10:36:13 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:08:40 UTC

Description Kenny Tordeurs 2018-08-11 10:25:39 UTC
1. Proposed title of this feature request
Add automatic pruning for tasks-backup 

2. What is the nature and description of the request?
When using  and having backup enabled it will by default make a backup first under /var/lib/foreman/tasks-backup and keep it there until someone manually cleans up the backups.

3. Why?
- Enable cronjob with => # satellite-installer --foreman-plugin-tasks-automatic-cleanup true --foreman-plugin-tasks-cron-line "00 15 * * *"
- Will follow the settings from /etc/foreman/plugins/foreman-tasks.yaml
- Backup is enabled by default for /var/lib/foreman/tasks-backup
- After a while /var/lib/foreman/tasks-backup will get very big

4. How to achieve this? 
- Add pruning interval for backups under /var/lib/foreman/tasks-backup to  foreman-plugin-tasks-automatic-cleanup

Comment 1 Rich Jerrido 2018-11-01 17:21:18 UTC
Do you want backups to be kept by age or by a certain number of backups?

Comment 2 Kenny Tordeurs 2018-11-02 07:51:21 UTC
I think pruning/keeping backups via age will be better then via quantity

Comment 3 Ben 2019-06-25 17:06:07 UTC
I'd very much like to see this additional functionality, please.

Comment 4 Bryan Kearney 2019-11-04 14:01:45 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.

Comment 16 Gaurav Talreja 2021-07-19 09:27:03 UTC
Verified.

Tested on Satellite 6.10.0 Snap 9.0

Setup: 
1. To run tasks cleanup every 5mins,
    satellite-installer --foreman-plugin-tasks-cron-line '5 * * * *'

Steps:
1. satellite-installer --foreman-plugin-tasks-backup true (which is default:false)
2. Verify TASK_BACKUP=true in /etc/cron.d/foreman-tasks (which is default:false)
3. Create any product or sync any repo to have a valid task.
4. Include this line "TASK_SEARCH='label = Actions::Katello::Product::Create'" to /etc/cron.d/foreman-tasks
5. Watch /var/log/foreman/cron.log for task cleanup of above labelled tasks.
6. Verify /var/lib/foreman/tasks-backup created and has details of cleaned up tasks.

Observation:
Using new flag --foreman-plugin-tasks-backup, No tasks are backup by default when cleaning up tasks from the database, and no /var/lib/foreman/tasks-backup created for backup tasks.

And this flag is set to true when upgraded to 6.10, and tasks cleanup works as previously, and /var/lib/foreman/tasks-backup gets created for any tasks backup when cleaned up.


Note: As per discussion with devs, this BZ covers only the cleanup part of /var/lib/foreman/tasks-backup, and not anything related to /var/lib/foreman-maintain/backup-tasks, so filed a new BZ for it, feel free to attach related cases to it.
https://bugzilla.redhat.com/show_bug.cgi?id=1983622

Comment 21 errata-xmlrpc 2021-11-16 14:08:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702


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