1

I have a remote Apache/2.2.16 (Debian) Server where I want to do intervalled jobs like every 2 hours do this, at 12.00 do this. So, I wrote a php file which can do this but I have to start it via the browser and have to keep the browser window open to keep the script running. I heard I could execute a php script via console, but I don't have access to it.

How can I run the script without access to the console and without having my browser opened?

4
  • Do you have at least web based CPanel with cron management? Commented Jan 15, 2014 at 12:45
  • 1
    Use curl or wget from a shell script. Commented Jan 15, 2014 at 12:47
  • how do I use a shell script? and no, there is no cron Commented Jan 15, 2014 at 12:50
  • You don't know how to use a shell script, but you're sure there's no cron on Debian? You first need to get console, or shell, access. Or have someone who does create a cronjob for you as @MrTweek suggested. Commented Jan 15, 2014 at 13:00

1 Answer 1

2

Set up a cron job for this task. You can set this up on the server or on any other computer that runs at the given time.

On a Linux or Mac OS machine, open a terminal and type crontab -e.

Add something like this to the end of the file:

0 12 * * * wget http://url.com/your/script.php -O /dev/null

This will call the script every day at 12:00. Make sure wget is installed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.