В Sun, 12 May 2013 09:17:09 +0200 Andrea Turrini <andrea.turrini@gmail.com> пишет:
Hi all, in order to remove [/var]/tmp/systemd-private-* directories that for sure are no more used, I followed Andrey's suggestion [0] and I have created the file
ori@orodruin:~> cat /etc/tmpfiles.d/remove-systemd-private.conf R /tmp/systemd-private-* - - - 3d R /var/tmp/systemd-private-* - - - 3d
but as you can see, I would remove directories that are at least 3 days old.
The problem is that all [/var]/tmp/systemd-private-* are removed except for the one created in the current boot.
That's correct. R causes file (directory) to be removed on boot.
I have also tried
R /tmp/systemd-private-* 3d R /var/tmp/systemd-private-* 3d
This is invalid syntax in the first place. I'd expect systemd-tmpfiles to ignore it, but OK, it is cosmetic bug.
but with the same result.
So, the question is: how do I remove only directories older than 3 days?
Copy /usr/lib/tmpfiles.d/tmp.conf into /etc/tmpfiles.d under the same name, remove (comment out) lines starting with X, and adjust cleanup period for /tmp (/var/tmp). But that's IMHO bad idea. The content of those directories is cleaned up following normal rules for /tmp. And directories themselves should remain as long as service is active. I do not think you restart services that define private tmp dirs so often that it becomes a problem.
Or is this a bug?
Behavior that you describe is not a bug. What is not possible indeed, is to set "inactivity period" for individual files or directories, so that file /tmp/foo is removed after a week and /tmp/bar - after a month. You have per-directory (e.g. /tmp) setting. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org