Page 1 of 1
shell_exec and cron!
Posted: Sun Feb 27, 2005 3:51 pm
by Joe
If I had a file named cron.php which executed a command would it be possible to set this as a cronjob using a PHP command such as shell_exec()?
Joe

Posted: Sun Feb 27, 2005 4:04 pm
by feyd
You mean use shell_exec() to set a crontab? I believe that'd all depend on the permissions your php has.. I'd think no.
Posted: Sun Feb 27, 2005 4:05 pm
by Joe
Hmm, I noticed that Cpanel etc allows you to set cronjobs, how is this possible without the use of a shell?.
Posted: Sun Feb 27, 2005 4:07 pm
by feyd
cpanel has more access rights than your php install..
Posted: Sun Feb 27, 2005 4:08 pm
by ast3r3x
Because you are probably trying to do something similar to me, I'll ask my question here.
I want a script to run daily that sends out an email to delinquent accounts. I was wondering if there is a way to do with even if the server is not accessed that day. I think cron jobs are out of the question because it's not a dedicated server.
I guess I could tell the guy he has to at least visit the site everyday, but thats such an inelegant solution.
Posted: Sun Feb 27, 2005 4:11 pm
by Joe
There is directories within home/etc such as cron.daily, cron.weekly etc. You can create files within these directories and they will run at the specified time. The only problem is permission errors. Trying something like:
Code: Select all
chmod -R 0777 /home/etc/cron.daily
via ssh fails to work.
