Systemd-tmpfiles Log Which Files or Directories Deleted

Latest response

Currently my team runs scripts via cron that prune a rather robust directory structure, log filenames of files/directories to be deleted (based on age), deletes said files/directories, and provides that information via syslog/email to certain individuals. My question is: "Is this possible to accomplish via systemd-tmpfiles?"

I've done some preliminary testing and I can indeed prune a copy of the directory structure, but I cannot seem to find a "baked-in" way to enable the logging of what gets deleted for reporting reasons (I understand it is primarily to be used for creation of volatile files/directories, my team and I are just curious if this use-case could be satisfied with the tool).

The [freedesktop.org site] (https://www.freedesktop.org/software/systemd/man/systemd-tmpfiles.html) mentions setting possible environment variables, but before we go down that rabbit hole on our team I figured we could "phone a friend" and ask the community if anyone has already given this a go.

Thanks in advance for any input!

Responses