You are not logged in.
Hi, I've just migrated to Arch from (K)ubuntu. In Ubuntu, I had "TMPTIME=1" in /etc/default/rcS. This meant that files in /tmp were deleted (during boot) only if they were older than 1 days.
Is there an equivalent setting in Arch? I couldn't find a pre-existing /etc/default/rcS, nor /etc/init/mounted-tmp.conf, which runs the deletion in Ubuntu.
Last edited by Salkay (2014-06-08 02:04:55)
Offline
Since /tmp is on tmpfs by default, they don't survive a reboot.
Offline
What's your reason for wanting temporary files to not be temporary yet remain in the directory for temporary files?
Offline
The files in /tmp are cleaned periodically by systemd-tmpfiles.{timer,service} though. So although they won't survive a reboot as Scimmia mentioned, they will also be cleaned out if you leave your system running for a long period of time.
To see what these times are set to, see the man page for systemd-tmpfiles and the /usr/lib/tmpfiles.d/tmp.conf file.
Offline
Oh sorry, I just realised I don't get subscribed to my own threads by default (I've just updated my prefs). Thanks for the prompt responses, everyone.
In the past (in Kubuntu), I would use /tmp to store semi-temporary things like short notes, screenshots, short scripts, and downloaded files. I might need these in the short term, for example if I wanted to email a file to someone. For a while, Kubuntu was crashing a lot, and I liked having these files persist just for a little while, to save me time.
I actually quite like Arch's idea of /tmp being cleared out based on time, not just on reboot. Also, since I'm now using Arch surely I'll be crashing a lot less! However, since making /tmp persist on reboot seems to be not so simple, I suppose I should just modify my workflow and save these files somewhere else.
Last edited by Salkay (2014-06-06 16:48:01)
Offline
/tmp doesn't neceessarily have to be on a tmpfs. The file /usr/lib/systemd/system/tmp.mount is what makes it default to that. But like all unit files, you can override it with your own. So if you would like to have it on the normal disk, you can do that. The tmpfiles.d config will still clean it up according to those intervals listed.
Offline
You could use /var/tmp which is not on tmpfs and defaults to 30 days before file removal.
Offline
You could use /var/tmp which is not on tmpfs and defaults to 30 days before file removal.
I don't think that /var/tmp is really meant to be used in the same way as /tmp. I recall seeing advice to not do this...
Offline
/tmp doesn't neceessarily have to be on a tmpfs. The file /usr/lib/systemd/system/tmp.mount is what makes it default to that. But like all unit files, you can override it with your own. So if you would like to have it on the normal disk, you can do that. The tmpfiles.d config will still clean it up according to those intervals listed.
Okay, thanks. I think I'll leave it for the moment. I'll live with the default for the moment. I've already spent tens of hours fiddling with my Arch install!
loqs wrote:You could use /var/tmp which is not on tmpfs and defaults to 30 days before file removal.
I don't think that /var/tmp is really meant to be used in the same way as /tmp. I recall seeing advice to not do this...
Ah, that's a pity. It's a good idea in theory, although 30 days is probably too long for me.
Offline