-1

We want to automate the process of removing old directories from /var/spool/abrt/.

We have RHEL machines - version 7.x.

The known way is to do the following

# systemctl stop abrtd
# systemctl stop abrt-oops

And we can remove all those directories and files with following rm command:

# abrt-cli rm /var/spool/abrt/*

And then start the services

# systemctl start abrtd
# systemctl start abrt-oops

We want to simplify the deletion process as the following -- it will delete the directories that are older than 10 days from /var/spool/abrt/

find /var/spool/abrt/  -type d -ctime +10  -exec rm -rf {} \;

is it a good alternative to purge the /var/spool/abrt/ directory?

shalom
  • 461
  • 13
  • 29
  • Dupe of https://unix.stackexchange.com/questions/556307/what-is-the-right-approach-to-purge-var-spool-abrt ? – rogerdpack Jun 03 '21 at 18:23

1 Answers1

2

If you purge crashes, deduplication will no longer work. Presumably, you would want to keep all the unique crashes around so repeats will be stored only once.

To remove them, might as well keep using abrt-cli. I think it is just a thin wrapper around unlinking the directory, but hopefully it has some safeties around only deleting crashes.

find /var/spool/abrt/  -type d -ctime +10  -exec abrt-cli rm '{}' \;
John Mahowald
  • 32,050
  • 2
  • 19
  • 34