Is it possible to increment a variable or array by 1 each time the script is executed.
An example would be, I execute the script and it sets a variable to $increment = '1';
I then close the script and come back 30 min later to execute the script again.
This time the variable needs to be $increment = '2';
The script will be run from cron every 30 minutes for a total of 8 times.
After the 8th execution the variable would need to be rewound back to $increment = '1';
Is this possible through session? Can session be setup for the cli sapi ?
Or would it be easier to output a text file with the next increment number and just pull the value from the text file?
All help is appreciated.
cookieorfile, if you don't want to use database.