Save your Raspberry Pi's SD card by logging to RAM

Flash memory inherently has a limited number of write/erase cycles. Inevitably, electrons get trapped where they’re not wanted, and the voltage levels shift, eventually causing read or write failure. Any given bit of flash memory is specified for a certain number of cycles before failure, but really it’s a random process and there could be a problem long before the numbers would predict on average.
mattdm@stackoverflow.com

$ curl -Lo log2ram.tar.gz https://github.com/azlux/log2ram/archive/master.tar.gz
$ tar xf log2ram.tar.gz
$ cd log2ram-master
$ chmod +x install.sh && sudo ./install.sh
$ sudo mv /etc/cron.hourly/log2ram /etc/cron.daily/log2ram
$ sudo reboot now

via log2ram@github.com