LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-15-2003, 04:20 PM   #1
VertiHost
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
Setting cron by php code?


Is it possible to set a cron job by php code?

For example, I have a script where you can select yes or no in the form. Depending on what the user selects the script sets a cron job or deletes it.

If the user selects "yes" then a cron is set via php code, if "no" then it is either deleted or not set.

Can this be done?
 
Old 10-15-2003, 06:41 PM   #2
jasonlambert
LQ Newbie
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware(x2), Debian, Redhat(x2)
Posts: 14

Rep: Reputation: 0
yes, it can be done...

it would proberly be a case of opening your crontab file and writing a new line to the end, or re-writing the file except for one line.

Check uk.php.net for file functions.

Jason
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
how to make a simple code for just restarting Apache via a Cron job hsa Programming 1 08-22-2005 04:15 AM
cron and PHP bokini Programming 2 07-28-2005 04:56 PM
Freshclam exit code & cron timmywo Linux - General 0 05-21-2005 10:55 AM
Setting a cron nitaish Linux - General 6 11-03-2004 07:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration