jjLin
jjLin

Reputation: 3291

How to run php jobs regularly in my Amazon EC2 server?

I have a Amazon EC2 server.
And I would like to run php jobs every 1 hours to get the latest information from websites and insert them into database.
But I am not good at server.
Any suggestions?

Upvotes: 0

Views: 489

Answers (2)

Freddie
Freddie

Reputation: 741

From this URL, you call crontab from the shell and to execute every hour, add the "00" at the beginning, point to the location of PHP and the script you want to run.

# crontab -e
00 * * * * /usr/local/bin/php /home/dir/myscript.php

Upvotes: 2

Parallelis
Parallelis

Reputation: 729

As for any Linux server, use crontab.

On the terminal (SSH) :

crontab -e

See the man page for cron

Upvotes: 1

Related Questions