loamguy Posted May 25, 2011 Share Posted May 25, 2011 Hi all, Newb here with a few months of PHP experience. I'm working on a project where if a web user signs up for a 30-day trial, they need to be notified near the end of that trial--let's say 25 days--that the trial is expiring. So I need some kind of batch process that runs in the background, perhaps every night at 1am, that looks at the signup date for all trial users and compares that date to the current date. If the difference is 5 days, then that user should be sent an email. Does anyone know how to set up a nightly batch process that like this? I'm not concerned so much with the date comparison as I am with getting a daily process to run in the background. Coldfusion has something called a Scheduled Task, but being new to PHP, I don't know what would be comparable. Any help welcome! Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/ Share on other sites More sharing options...
cssfreakie Posted May 25, 2011 Share Posted May 25, 2011 you could have a look in to something called cronjobs Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1220287 Share on other sites More sharing options...
jcbones Posted May 26, 2011 Share Posted May 26, 2011 If you are running a *nix server, use crontabs. If you are running winDoze server, use task scheduler. Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1220352 Share on other sites More sharing options...
loamguy Posted May 28, 2011 Author Share Posted May 28, 2011 Ok, thanks all! Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221534 Share on other sites More sharing options...
loamguy Posted May 28, 2011 Author Share Posted May 28, 2011 Looks like our godaddy server is hosting IIS and they say we won't have authority to create a task. Are there any 3rd-party tools that could run a PHP URL once a day maybe? Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221542 Share on other sites More sharing options...
gevensen Posted May 28, 2011 Share Posted May 28, 2011 Looks like our godaddy server is hosting IIS and they say we won't have authority to create a task. Are there any 3rd-party tools that could run a PHP URL once a day maybe? surely godaddy has a chronjob in its cpanel, thats the way to go Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221544 Share on other sites More sharing options...
.josh Posted May 28, 2011 Share Posted May 28, 2011 Looks like our godaddy server is hosting IIS and they say we won't have authority to create a task. Are there any 3rd-party tools that could run a PHP URL once a day maybe? surely godaddy has a chronjob in its cpanel, thats the way to go I'm sure they do..but he said that they said "we won't have authority to create a task". ...which means he's probably on a really cheap hosting plan. Most really cheap hosting plans do not let you do things like that. Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221551 Share on other sites More sharing options...
jcbones Posted May 28, 2011 Share Posted May 28, 2011 Godaddy doesn't use cpanel. Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221571 Share on other sites More sharing options...
xyph Posted May 28, 2011 Share Posted May 28, 2011 I'm sure godaddy unix would allow a cronjob. He's on a godaddy windows server though. Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221583 Share on other sites More sharing options...
.josh Posted May 28, 2011 Share Posted May 28, 2011 Right..and it would have its own cron equivalent. Virtually all systems have ability to schedule execution of something on a regular basis...I assure you that's not the issue. Issue seems to be that he's apparently not allowed to, and its probably because he has some super cheap hosting plan Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221585 Share on other sites More sharing options...
xyph Posted May 28, 2011 Share Posted May 28, 2011 Because setting up a sched task for a windows user... hell active directory itself, is SUPER ANNOYING to deal with. Generally, sched tasks on shared hosting machines can lead to security issues. nix does a much better job of handling this kind of stuff, and crons are easily made with specific user permissions. That's why even cheap nix plans generally allow crons. I have set up crons on a client's economy godaddy hosting plan. I can even set up SSH if I'd like. Your solution is to get GoDaddy to move you to a Linux server, and use a cron. Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1221625 Share on other sites More sharing options...
loamguy Posted June 4, 2011 Author Share Posted June 4, 2011 Yeah, we are stuck with IIS on this hosting package (there is both ASP.net and PHP involved). Does anyone know of a 3rd party tool that could ping a PHP url? If I set up a file to poll MYSQL and send out emails, does anyone know of a service I could use to hit that URL on a nightly basis? Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1225102 Share on other sites More sharing options...
xyph Posted June 4, 2011 Share Posted June 4, 2011 Set up a task on your home computer to visit a secret URL every night? Quote Link to comment https://forums.phpfreaks.com/topic/237459-how-to-set-up-a-nightly-batch-process/#findComment-1225116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.