freelance84 Posted July 8, 2010 Share Posted July 8, 2010 I may need an alternative to cron to get some scripts on my site running automatically to remove unwanted mysql entries. I've google it and there seems to be a few, one being http://sourceforge.net/projects/pinc/files/ Does anyone know of any others or had experience with them? If not, would there be a way of starting a script on the server which ran all the way to the bottom, paused for a minute then hit a header which was back to its self, thus causing an infinite loop until something changed? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 while(true) { // do something sleep(60); } Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 May also need: set_time_limit(0); at the top. Quote Link to comment Share on other sites More sharing options...
freelance84 Posted July 8, 2010 Author Share Posted July 8, 2010 But how would i keep the script going. Surely If i turn off the computer which started the script the script would stop? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 But how would i keep the script going. Surely If i turn off the computer which started the script the script would stop? Well yes. There is no script or app that will continue when you turn of the computer. If you mean how to start back up when the computer boots, then that depends on the OS. Linux you put it in /etc/init.d/ or wherever and Windows you put it in startup. Quote Link to comment Share on other sites More sharing options...
freelance84 Posted July 8, 2010 Author Share Posted July 8, 2010 Yea, thanks. But after talking it over with a friend, I've decided to build in a work around so i don't need the script to run automatically. Instead I'm going to wait until my host installs MySQL 5.1 as apparently this has some event scheduling functions which eliminate the need for me to use cron. I am very new to this world of php...etc but it seems there is a need a more localised version of cron. One which is private and unique to each user on a server. A little like .htaccess maybe, one which people can write to but it will only control the contents of their directories on the server/ host. Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 Yea, thanks. But after talking it over with a friend, I've decided to build in a work around so i don't need the script to run automatically. Instead I'm going to wait until my host installs MySQL 5.1 as apparently this has some event scheduling functions which eliminate the need for me to use cron. I am very new to this world of php...etc but it seems there is a need a more localised version of cron. One which is private and unique to each user on a server. A little like .htaccess maybe, one which people can write to but it will only control the contents of their directories on the server/ host. That is crontab. If you type crontab -e it will allow you to edit only your crontab and your cron entries will be run as your uid with only the permissions of your uid. Of course if you do this as root, then you are editing root's crontab. 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.