arcctl: controldir cleanup implementation
Implementing the arcctl cleanup controldir
.
Available cleanups:
-
--wipe
- remove job-related directories from controldir, leaving the RTEs, accounting, etc intact. The recommended way to give a CE a fresh start, without accidentally removing RTE links and accounting database😄 -
--gc
- garbage collection. Removes empty directories in the jobs tree. Correlate a-rex.status
files with job directories and removes the orphaned metadata that does not have a corresponding status. Aimed for cleaning up controldir garbage accumulated over the unclean shutdowns. -
--finished-before
- aimed to remove old finished jobs metadata. This acts as force cleaner in addition to jobs ttl in a-rex
All cleanups are intended to be run with A-REX stopped. arcctl
will raise an error is A-REX is running. Can be overridden by --force
on own risk.
arcctl
also shows warning that cleanup cannot be undone and backup is recommended before wiping the metadata. Additional layer of cleanup confirmation can be overridden with --yes
option.
Controldir cleanup also support the --dry-run
mode. In this mode, no desctuctive action are performed, just log is printed. This is a good way to check what will be deleted beforehand. For most curious users, running with -d DEBUG
will show what exact commands will be executed.