dietpi-logclear - which option is doing what

when I execute

sudo dietpi-logclear

I get this info:

$ sudo dietpi-logclear
[ INFO ] DietPi-Logclear | Available commands:

 dietpi-logclear 0
 Backup contents of all log files from /var/log to /root/logfile_storage/*.
 Also clears the contents of all logs files in /var/log.

 dietpi-logclear 1
 Clear contents of all logs files in /var/log.

 dietpi-logclear 2
 Physically delete all files in /var/log and backups in /root/logfile_storage/*.
 May prevent log files from being updated, restart services or reboot.

When I display the content in /boot/dietpi.txt I get this info:

# Logging Mode Selection: 0=none/custom | -1=RAMlog 1h clear | -2=RAMlog 1h save clear | -3=rsyslog + logrotate

In my opinion this is not consistent and my question is:
Which option must I configure to use RAMLOG and save the logfiles before deletion?



many thanks for your question. From end user point of view you just need to run dietpi-software and select the Log System of your choose. Basically this will do the right settings.

AUTO_SETUP values within /boot/dietpi.txt are applied on first boot of DietPi only, once!

dietpi-logclear is just the worker shell script within the background. It’s called once a hour if your have selected RAMlog as loging method)