#How to put static data in ram memory with a script?
1 messages · Page 1 of 1 (latest)
Write a C program and use malloc?
Be more specific, what's your goal: why do you want to store data in ram? What kind of data? Just any data or do you have something specific? What do you mean by a script? You can store something in memory when you make a variable in whatever language you want.
Oh I see
it tells you what to do
then you just use /mnt/ramdisk or whichever other directory you choose as you would with any other directory
creating files and modifying them and that stuff
and it will stay in ram
To run the service on startup you can use systemd: man systemctl
Just literally follow the instructions
Well you dont need to create /mnt/ramdisk everytime but you do wanna mount it and copy the data from your "hard disk"
You should also google what a systemd wants out of a unit file
ok thx i will do that
To see what cp works you can google it or check out the manual page in your shell: man cp
yeah i know a little linux commands
and i know how to make a unit file
but yeah i'm just struggling with what i need to set in my .sh file
I think you just wanna run that mount command and then the cp the html file to the ramdisk
yeah i already did that
systemctl enable servicename --now
Will enable it on boot and start the service without the need for reboot too
Yea but in the shell script
ahh
Bc you wanna mount if everytime and then copy it bc ram is volatile