Hi,
I do not want to preserve changes to(in) /var/log and /tmp dirs, how to make them fresh clean at every boot?
Thanks, Michal
/tmp and /var/log cleanup at boot
Re: /tmp and /var/log cleanup at boot
Open /etc/rc.d/rc.local, create a new line in the end and put this:
If you're not using save-changes cheatcode, then create /porteus/rootcopy/etc/rc.d/rc.local inside your Porteus bootable device and write the commands above.
Another option is to delete them at shutdown process. Use the same commands above, but inside: /etc/rc.d/rc.local_shutdown
Code: Select all
echo guest | sudo -S rm -rfd /var/log/*
echo guest | sudo -S rm -rfd /tmp/*
Another option is to delete them at shutdown process. Use the same commands above, but inside: /etc/rc.d/rc.local_shutdown
-
- White ninja
- Posts: 13
- Joined: 20 Mar 2017, 14:41
- Distribution: Porteus Desktop
- Location: Czech Rep.
Re: /tmp and /var/log cleanup at boot
rc.local is run before any other programs, which can write to /tmp and /var/log?
Re: /tmp and /var/log cleanup at boot
Yes, it is. But maybe it's better to use the shutdown script
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /tmp and /var/log cleanup at boot
Not so sure here. In the Web seen posts asserting that rc.local is first to be run, but after doing a diagnostic, it seems rc.S runs before rc.local.michalh wrote:rc.local is run before any other programs, which can write to /tmp and /var/log?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB