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? Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/ 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. Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970363 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? Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970382 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. Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970385 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" Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970390 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. Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970393 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 Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970405 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. Link to comment https://forums.phpfreaks.com/topic/183838-cron-setup/#findComment-970407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.