store variable in memory

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
florachan
Posts: 56
Joined: Tue Aug 04, 2009 11:27 pm

store variable in memory

Post by florachan »

Hi This probably a dumb question but I can't find the answer anywhere , perhaps someone could enlighten me. I finally manage to get my gargoyle up and running .

I realise that it can do shell script and I wonder how can I save the variable to memory instead of text file (flash).

cheers,
Flora

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: store variable in memory

Post by Eric »

If you write a file to /tmp you're effectively writing to memory, since /tmp is mounted as a RAM disk. It's a lot faster than writing to flash and it doesn't run the risk of writing too often to the flash chip (which has a read/write max of 100,000). However, /tmp gets wiped every time you reboot since it's just memory.

florachan
Posts: 56
Joined: Tue Aug 04, 2009 11:27 pm

Re: store variable in memory

Post by florachan »

Eric wrote:If you write a file to /tmp you're effectively writing to memory, since /tmp is mounted as a RAM disk. It's a lot faster than writing to flash and it doesn't run the risk of writing too often to the flash chip (which has a read/write max of 100,000). However, /tmp gets wiped every time you reboot since it's just memory.

cool , thanks . gonna try it tonite

Post Reply