Reducing wear on your sd-card

One way to increase the lifespan, and presumably, reliability of the sd-card, currently being hammered, in your Pi is to put some of the temporary files into memory.

Add the following to your /etc/fstab

tmpfs /var/log tmpfs nodev,nosuid,size=50M 0 0

If the size isn’t specified then half of the machine’s memory is used.
nodev and nosuid are security options, the suggestion is that these only need setting for public facing machines.

 

8-Jan-2018: If you’re using the lighttpd web server then be aware that it stores files in /var/log, and it doesn’t like them being removed. This will cause the server to fail to start.