You are not logged in.

#1 2012-06-24 12:07:38

skuda
Member
Registered: 2010-11-29
Posts: 9

tmpfiles.d /tmp not cleaned

I noticed my /tmp directory isn't cleaned on boot, after search the forums and read any posts i know that:

1) /tmp should be mounted tmpfs, i have indeed found a fstab.pacnew with the change but i don't want /tmp directory mounted on ram because i use it for many thinks that i don't mind to lose on reboot but it is big size by nature, for example i have downloaded in the last hour Qt Creator and compiled it with debug symbols to obtain a backtrace, i don't need anymore but it is fine to maintain there any days (just in case), if it is there good if i lost it no problem.

2) i could use tmpfiles.d syntax to get my /tmp cleaned on boot, sometimes i have lost power and i lost a bit of job (maybe 1 of every 100, the other are older crap directories that i want deleted anyway) in /tmp that gets cleaned on boot so what i would like to really do it is clean all of /tmp that have not been modified in the last 24 hours, i thought i could get this result if i used this line "d /tmp 1777 root root 1d" in a /etc/tmpfiles.d/tmp.conf but i can't, all my files are still there after reboot or after launch manually  "systemd-tmpfiles --remove --create /etc/tmpfiles.d/tmp.conf" or "systemd-tmpfiles --clean /etc/tmpfiles.d/tmp.conf", if i use "D /tmp 1777 root root 1d" it gets all ever deleted so i don't know how to get the desired effect.

How could i do? Thanks!

Offline

#2 2012-06-24 14:05:29

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: tmpfiles.d /tmp not cleaned

skuda wrote:

/tmp should be mounted tmpfs

Exactly, the best is to add the entry to the fstab, as this is the new default in arch linux.

skuda wrote:

i use it for many thinks that i don't mind to lose on reboot

Simply create a new directory anywhere outside of /tmp (Home folder?!).

I am sure you can find something that deletes files unmodified for x minutes on your own.
If you want to check for files ,that are ready to delete, automatically use cron.
cron
Also using systemd for that purpose is not a good idea, as you do not want additional disk I/O on each boot.

Last edited by teateawhy (2012-06-24 14:08:02)

Offline

#3 2012-06-24 14:39:17

skuda
Member
Registered: 2010-11-29
Posts: 9

Re: tmpfiles.d /tmp not cleaned

Yes i am thinking the best it is to change my habits too, i want to stay as close as possible to a pristine Arch Install to avoid possible problems in the future so i will go this route. Thanks.

Offline

Board footer

Powered by FluxBB