Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #270076 > unrolled thread

systemd-tmpfiles: file globbing?

Started byFrank Van Damme <frank.vandamme@gmail.com>
First post2024-06-13 12:20 +0200
Last post2024-06-13 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  systemd-tmpfiles: file globbing? Frank Van Damme <frank.vandamme@gmail.com> - 2024-06-13 12:20 +0200
    Re: systemd-tmpfiles: file globbing? Greg Wooledge <greg@wooledge.org> - 2024-06-13 14:10 +0200

#270076 — systemd-tmpfiles: file globbing?

FromFrank Van Damme <frank.vandamme@gmail.com>
Date2024-06-13 12:20 +0200
Subjectsystemd-tmpfiles: file globbing?
Message-ID<IOPIK-2D39-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

systemd-tmpfiles-clean will watch directories and periodically purge old
contents.

eg
d /var/cache/man 0755 man man 1w

will delete files older than a week from /var/cache/man

Is there a way to apply max lifetimes to files matching a pattern? I can't
find any way to tell it to, say, remove *.txt files older than a month from
/tmp/foo.


-- 
Frank Van Damme
Make everything as simple as possible, but not simpler. - Albert Einstein

[toc] | [next] | [standalone]


#270078

FromGreg Wooledge <greg@wooledge.org>
Date2024-06-13 14:10 +0200
Message-ID<IORrb-2EpQ-3@gated-at.bofh.it>
In reply to#270076
On Thu, Jun 13, 2024 at 12:00:25PM +0200, Frank Van Damme wrote:
> Is there a way to apply max lifetimes to files matching a pattern? I can't
> find any way to tell it to, say, remove *.txt files older than a month from
> /tmp/foo.

If you're willing to turn away from systemd, find(1) can do this.

    find /tmp/foo -type f -iname '*.txt' -mtime +31 -delete

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web