Scenario: in the actual application environment, we need to independently mount the log directory to a partition or a virtual memory disk. If you mount/var/log to the memory virtual disk and the file format is tmpfs, You need to calculate it carefully. After all, memory resources are always limited, not to mention embedded operating systems. Therefore, it is best to allocate proper memory space during mounting. The so-called fit should be the maximum capacity generated by logs when the system load is the heaviest. If logs are continuously generated, the entire operating system will be filled. In this case, you should start logroate to store and delete redundant log files. However, this logrotate Log service runs once a day and requires detailed configuration. Here, we suggest porting this log to the hourly plan, which should not work, because the log generated files are named by date. So what we need to test is to generate the maximum log capacity every day, and then calculate the logs that need to be stored for several days.
Had better: It is recommended that you store logs hourly. Then, you can view the maximum number of stored logs. The rotate is used to calculate the total size !!
Storage and Analysis of logrotate log capacity