phpretard Posted December 3, 2009 Share Posted December 3, 2009 I know how to setup cron. I need to know if there is a way to setup cron via php. For example. When you install wordpress or Joomla there is a wizard of sort to install the database and configure some files. Is there such a script to do the same with cron? Quote Link to comment Share on other sites More sharing options...
trq Posted December 3, 2009 Share Posted December 3, 2009 You can execute any programs you like via the exec functions. Quote Link to comment Share on other sites More sharing options...
phpretard Posted December 3, 2009 Author Share Posted December 3, 2009 So I have files in a Plesk Skeleton for newly added domains. Within the files there are a few that requires cron for the site to run properly. With exec() I can write this into linux? Quote Link to comment Share on other sites More sharing options...
trq Posted December 3, 2009 Share Posted December 3, 2009 With exec() I can write this into linux? I have no idea what that means, but with exec, you can execute Linux commands. Quote Link to comment Share on other sites More sharing options...
phpretard Posted December 3, 2009 Author Share Posted December 3, 2009 I'm not sure I do either Can I write $this into linux using exec() not having to use SSH or Plesk? $this="*/1 * * * * /usr/bin/php /var/www/vhosts/website.net/httpdocs/a_assign_appraiser.php" Quote Link to comment Share on other sites More sharing options...
trq Posted December 3, 2009 Share Posted December 3, 2009 Can I write $this into linux using exec() not having to use SSH or Plesk? You can, but its far from a valid command. Firstly, cron jobs need to go in a users crontab file. Secondly, the user apache runs as will need to have sufficient permissions to act as this user to add jobs to crontab. Instead of explaining how you need to do things, explain (in basic terms) what it is you want to do. There might be easier ways. Quote Link to comment Share on other sites More sharing options...
phpretard Posted December 3, 2009 Author Share Posted December 3, 2009 I don't want to have to manually set up a cron job everytime I set up a domain Quote Link to comment Share on other sites More sharing options...
trq Posted December 3, 2009 Share Posted December 3, 2009 I don't want to have to manually set up a cron job everytime I set up a domain Firstly, why would you need to? Secondly, why wouldn't you just script this into whatever script adds the domain? Once again, I think your only telling half the story. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.