Welcome Guest, Not a member yet? Register   Sign In
Crontab when shared-hosting does not support it
#1

[eluser]micha8l[/eluser]
Crontab is like schedules tasks on Windows, it allows you to schedule certain 'tasks' or 'jobs' to run a timely intervals.

One of my clients is requesting that I automate certain jobs from them at timely intervals using crontab, I've not yet explained to them that their shared-hosting account does not support it, however I would like to offer a viable solution.

I've considered poor-mans cron job, that is executing PHP scripts on the server when the site gets a visitor. But if the site doesn't get many visitors anyway, then visitors it does get aren't going to be impressed by the timely wait as the php scripts execute (not good.)

The there's the solution I want to discuss.

This method would require use of a computer other than the shared-hosting one.

The idea is that the shared-hosting owner, runs an application on their home computer that'll query the web application on the shared hosting server. Using a particular format in the URL possibly, "dd-mm-yy/script-to-be-executed/authentication-password"

I could even set up database tables and have the authentication password stored there, I could have separate directory for the scripts to be executed. I could even get this all automated by crontab in Linux.

Am I reinventing the wheel here, has this been done before?
#2

[eluser]Daniel Moore[/eluser]
I have seen a number of shared hosting providers where accounts "seemed" to not have the ability to do cron jobs. However, upon deeper research, I have learned that they all indeed had it available, though not necessarily in an easy to use interface. One even had to be taken care of through SSH using Putty and the command line.

Before "reinventing" the wheel, let's double check the wheel's specs. What is the hosting provider, and what account type does the client have with this hosting provider? Perhaps with that info, I may be able to do a bit of research in my spare time today and offer some help. Of course, it could be that they don't allow access to cron jobs due to abuse in the past, but that is rare, even for shared hosting.

I was with my hosting provider for a year before I discovered I had the cron capability. Sometimes it takes getting the right person on the line in tech support, because the vast majority of tech support at these companies know very little about what they are supposed to be doing.
#3

[eluser]micha8l[/eluser]
[quote author="Daniel Moore" date="1344863853"]I have seen a number of shared hosting providers where accounts "seemed" to not have the ability to do cron jobs. However, upon deeper research, I have learned that they all indeed had it available, though not necessarily in an easy to use interface. One even had to be taken care of through SSH using Putty and the command line.

Before "reinventing" the wheel, let's double check the wheel's specs. What is the hosting provider, and what account type does the client have with this hosting provider? Perhaps with that info, I may be able to do a bit of research in my spare time today and offer some help. Of course, it could be that they don't allow access to cron jobs due to abuse in the past, but that is rare, even for shared hosting.

I was with my hosting provider for a year before I discovered I had the cron capability. Sometimes it takes getting the right person on the line in tech support, because the vast majority of tech support at these companies know very little about what they are supposed to be doing.[/quote]

That's very nice of you to offer, the host is 123-reg on Linux shared hosting.
#4

[eluser]Daniel Moore[/eluser]
I looked at their web page at http://www.123reg.com/shared.php

This is the shared hosting accounts they offer. Cron is standard on all 3 choices.

Therefore, all you need to do is write the maintenance script itself, and schedule it to run in the cron service, since it is available with that hosting provider. It should be available to configure through the CPanel Control Panel interface.





Theme © iAndrew 2016 - Forum software by © MyBB