Krydos Posted April 29, 2017 Posted April 29, 2017 No, because not everyone who uses mysql on our servers lives in Sao Paulo timezone. Just use this command in php:date_default_timezone_set("America/Sao_Paulo"); By the way you can do the simple queries I listed in my code with one mysql query. I just wanted to show you how to do a loop over each of your accounts because it seemed like it might be useful to you.update accounts set accounts.enabled = '0' where accounts.type = 'FREE' and accounts.reg_date < (date_sub(curdate(), interval 15 day));
flpcarv Posted April 30, 2017 Author Posted April 30, 2017 Hello, you told me to tell you when I am done with my Cron Job. I create a new cron job that should executed every 12 hours, could't test the cron job itself but the php code is working. The command line is php -q /home/flpcarv/private/expireTrialLicenses.php I am not sure if its "OK" to leave the path like that or I should put somewhere else. I think the cron job should run every 1 hour. Well thats it, thanks.
wolstech Posted April 30, 2017 Posted April 30, 2017 The way krydos does it, I believe it needs to be runnable in a browser, so it will need to be inside public_html somewhere.
Krydos Posted April 30, 2017 Posted April 30, 2017 If it only needs to be run once every 12 hours then you can use it the way it is with the cron page in cpanel. If you need it once an hour as you said earlier then you need to move your script to somewhere under public_html so it's accessible from a browser.
flpcarv Posted May 1, 2017 Author Posted May 1, 2017 Yeah I realised that its ok to let it update every 12 hours.But I am not sure if its working, Am I allowed to set it to every minute just to test it? Once its done I will set to every 12 hours. By the way I am feeling that the server is inaccessible very often, and it seens like Tommy is a little bit more stable, would be a problem to "delete" my Jhonny host and create a new Tommy? http://heliohost.grd.net.pl/monitor/
Krydos Posted May 1, 2017 Posted May 1, 2017 If you run more than 2 cron jobs in a day all of your cron jobs will be deleted. Yeah, Tommy is much more stable. That's why we call him the stable server, and Johnny the unstable server. You can switch if you would rather have a server with better uptime.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now