On Red Hat Satellite 6 'tasks-backup' directory gets created automatically under /var/lib/foreman path after cleaning the tasks.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.x

Issue

  • TASK_BACKUP directory gets created automatically under /var/lib/foreman when tasks are cleared using command foreman-rake foreman_tasks:cleanup command.
  • tasks-backup directory 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-backup in case the relevant tasks cleanup completed successfully.

  • As a preventive step to avoid creating those subdirectories, run foreman-rake command with option TASK_BACKUP=false.

  • Passing TASK_BACKUP=false option to the command will not create any directory like task-backup under /var/lib/foreman path 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:cleanup command, check newly created "task-backup" directory
    under /var/lib/foreman path and check how much space this directory has consumed on the file system.
SBR
Product(s)
Components
Category

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.