0

I have a scree.php file in the path:

xxx/.../Home/scree.php

I want to execute it per 5 minutes, and make sure it is thread-safety. How to do that?

I am under XShell.

Franklin Yu
  • 8,920
  • 6
  • 43
  • 57
qg_java_17137
  • 3,310
  • 10
  • 41
  • 84

2 Answers2

0

It can be done using crontab.

  1. Type "crontab -e" in your terminal.
  2. Paste in the following code:

    */5 * * * * php /Home/scree.php

  3. Exit out of your editor.

Learn more about crontab here.

0

You can edit the crontab in XShell:

crontab -e

Then in the file, you should add the code:

*/5 * * * * root usr/bin/php xxx/.../Home/scree.php

Then esc :wq out of the file.

If it shows:

crontab: installing new crontab

means success.

aircraft
  • 25,146
  • 28
  • 91
  • 166