On Red Hat Satellite 6 'tasks-backup' directory gets created automatically under /var/lib/foreman path after cleaning the tasks.
Environment
- Red Hat Satellite 6.x
Issue
TASK_BACKUPdirectory gets created automatically under/var/lib/foremanwhen tasks are cleared using commandforeman-rake foreman_tasks:cleanupcommand.tasks-backupdirectory consumes too much of space on the disk.
Resolution
-
As a reactive step, it is safe to delete any subdirectory under
/var/lib/foreman/tasks-backupin case the relevant tasks cleanup completed successfully. -
As a preventive step to avoid creating those subdirectories, run
foreman-rakecommand with optionTASK_BACKUP=false. -
Passing
TASK_BACKUP=falseoption to the command will not create any directory liketask-backupunder/var/lib/foremanpath upon task cleaning.
# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' AFTER='5d' TASK_BACKUP=false
-
Additional Information:
-
Below parameters can also be used as an option to perform different operations except cleaning the tasks:
* **TASK_SEARCH** : scoped search filter (example: 'label = "Actions::Foreman::Host::ImportFacts"') * **AFTER**: delete tasks created after *AFTER* period. Expected format is a number followed by the time unit (s,h,m,y), such as '10d' for 10 days * **STATES**: comma separated list of task states to touch with the cleanup, by default only stopped tasks are covered, special value all can be used to clean the tasks, disregarding their states * **NOOP**: set to "true" if the task should not actually perform the deletion * **VERBOSE**: set to "true" for more verbose output * **BATCH_SIZE**: the size of batches the tasks get processed in (1000 by default) * **TASK_BACKUP**: set to "true" or "false" to enable/disable task backup
-
Diagnostic Steps
- Upon cleaning the tasks using
foreman-rake foreman_tasks:cleanupcommand, check newly created "task-backup" directory
under/var/lib/foremanpath and check how much space this directory has consumed on the file system.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.