Jump to content

[Solved] Create a cron job


micasa52

Recommended Posts

Use something like this (you can replace the numbers in ea-php56 to change PHP versions, 54, 55, 56, 70, 71, 72 are supported.)

ea-php56 -q /home/username/path/to/file.php

Also, I would suggest not running right at midnight for load reasons. If you need it run around that time, set it for a few minutes before or after (e.g. 0:06 or 23:57)

Link to comment
Share on other sites

  • 4 weeks later...

Hello again!!

 

The cron job is working but not well. I have a php page with an activity that send some emails with attachment to some email directions. The activity works fine when I execute from a web page. From the crob job the same activity only send an email without that attachment. There's the cron job any limitaton?

 

Thak you so much!

Link to comment
Share on other sites

When I ran the command manually it took about 30 seconds to finish and that was with Johnny's load at only 4. Php scripts have a maximum time that they can run, and if they exceed the limit they are killed. I wouldn't surprise me at all if the load was high on Johnny when your cron tried to run, and it was so slow that it timed out before finishing everything.

 

I'm sure you've heard the spiel before, but Johnny isn't a production server. We only recommend using Johnny until you're done experimenting and then move to a better server. Ricky has good uptime, but Tommy is considerably faster. Free signups for Ricky start at midnight UTC and usually fills in about 5 minutes. Tommy free signups also start at midnight UTC, and usually fill in about 5 seconds. If you're interested in switching servers an admin can move your account for you if you're a donor. Otherwise the process to switch servers is 1) backup 2) delete the Johnny account 3) hope you're fast enough to snag a production server slot, and 4) restore your backup.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...