Dynamic cron job

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6229
  • Loc: South-Africa

Post 3+ Months Ago

Is there a way with PHP to set up a cron job without actually going in to cPanel and setting it up there ... basically I am writing a mailer/newsletter module and I'd like to have a setup for it where it automatically sets up a cron job instead of having to do it for every website I build.

for all these websites I will be using cPanel.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

My first thought has to do with whether PHP is running as the same user as the crontabs you want to edit and whether you can use system(), exec(), etc in PHP to edit the cron jobs with something "crontab -l | editor | crontab -"

Then I started wondering whether it might be time to rethink the need for multiple cron jobs and just rewriting the current system to use one cron job for a dynamic number of sites.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6229
  • Loc: South-Africa

Post 3+ Months Ago

joebert wrote:
Then I started wondering whether it might be time to rethink the need for multiple cron jobs and just rewriting the current system to use one cron job for a dynamic number of sites.

That makes a lot of sense ... I think I might rather look into something like this. That way I don't have to worry about setting it up each time, rather just somehow telling the cron job which sites to look at.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 37 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.