Raspberry Pi Setup Tmfs to Save Files to Memory
To avoid SD card wearing these files could be written to a virtual drive in RAM. This guide shows how to set up a 1 MB RAM drive on your Raspberry Pi.
Goal is to have a 1MB directory in RAM for temporarily storage. First create the tmp dir:
sudo mkdir /var/tmp
then edit the fstab file by
sudo nano /etc/fstab
and add the line
tmpfs /var/tmp tmpfs nodev,nosuid,size=1M 0 0
save and close the file. Now issue
sudo mount -a
To check if your operation succeeded issue
df
which should report (among the other disks) a tmpfs with 1024 1K blocks (=1MB) as /var/tmp
http://www.domoticz.com/wiki/Setting_up_a_RAM_drive_on_Raspberry_Pi