I have a Cron which gets executed by EasyCron once every 10 minutes and throws a cURL request (with PHP) to update some users' data.
The problem is that the website that I get the information from blocks anyone who makes that request after some time.
So I have to do pass some data (an integer is enough) to the next Cron depending on the result of my CronJob. If I get an error, I stop requesting that information for some time to prevent my website from being blocked for a day or more.
Since I can't use sessions, a workaround could be a blank file with only a number in it, but I'm searching for a cleaner solution... A way to pass the information via GET request or a sort of SESSION depending on the result.
Thank you for any response.
You have multiple options;
In this case you would just put the values to the file and pass read it from the other cron job. If you also need to keep the type, then you can store the variable type as a string, and translate it to type in the other cron job.
Here you store the variable in a database, and read it in the similar way from the other cron job
These are popular ways to do it. However if you implement it for socket file you wont be able to use it on windows, only on linux environments
for example: export VARIABLE
, and in the other script you would take this value, then clear it.