centos7 tmpfiles.d deleted outdate files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi all,

I use centos7 and don't want to use tmpwatch as well as crond.

I have a question to use `systemd-tmpfiles-clean.service` with my custom configured file in `tmpfiles.d` to delete outdated files periodically in some log dir.

I have a `tmpfiles.d` configured file in `/etc/tmpfiles.d` named `my_log.conf` in following contents.

```
#Type  Path    Mode  UID   GID   Age   Arg
r /chenqiang 0775 root root 10s
r /chenqiang/test_10s
r /chenqiang/test_20s
```

If I run `systemd-tmpfiles --remove` with above configure, all files and dir will be deleted if I set 'r' type for the files and dir. but, I want to only delete some outdated files in the dir. and I use `systemd-tmpfiles --clean` with following configure.

```
#Type  Path    Mode  UID   GID   Age   Arg
d /chenqiang 0775 root root 10s
f /chenqiang/test_10s 0660 root root 10s
f /chenqiang/test_20s 0660 root root 20s
```

It can delete dir if the age > 10s, but can't delete the files in it.

So, would some one help me if I want to delete the outdated files ?

--
Best Regards,
Chen, Qiang

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux