If you want data persistence between program runs, you need to store the data in files. For example, you could save the variable x
to a file like this:
h = fs.open("filename","w")
h.writeLine(x)
h.close()
And you could load it like this:
h = fs.open("filename","r")
x = tonumber(h.readLine())
h.close()
Here is the documentation. http://computercraft.info/wiki/Fs.open