Jump to content

Recommended Posts

hmm im looking at pseudo cron and its looking a whole lot more reliable for on a commonly distributed application than cron, only problem is its a request based thing, still as long as i don't need anything to happen before a user views the site it seems fine.

 

if its just for trimming databases can anyone see a better solution?

I'm replying from a debian perspective.

 

The problem isn't the exec function, the issue is apache is running as user www-data. It is not wise to execute scripts through apache as root on a production box.

 

What I eventually did was to create a text file (as www-data) containing the cron contents and place it in a non-web-accessible folder. I wrote a php script which is executed by cron every minute to read the contents of the folder for any new 'cron' files. When a file is found, change the owner to root and move the file to /etc/cron.d/

 

That works for me.

hmm sorry guys i dont think i made myself all that clear.

 

im developing something which will be used on servers where people are not admins,

 

eg a general hosting account

 

and most free accounts dont allow cron do they?

if ya have access to cpanel, ya shud have access to cron thru cpanel interface.

 

if ya have that, ya can setup a php script to post current crons and check another file for any updates

 

than as e3d said, ya have a web interface, which checks current crons as well as post the updates...

 

actually sounds like a fun project.

 

 

but if ya dun have access to cronjobs, ya wud have to go with a pseudo type cron, which is run on page loads instea, it works, but it wont run at the exact time. on popular sites, this system isnt bad, but on low hit sites, it can be awhile before it updates.

 

yeah im building a forum system and basically i was thinking of using cron to clean the active users, but i guess no real need considering the table size isnt going to change if no user logs in lol

and the stats would be viewed by the user. hence updating the page

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.