Results 1 to 3 of 3
Hi There,
Does anyone have any ideas about editing crontab programmatically using PHP.
When a crontab file is created by a user, where does it actually live ?? Which directory ...
- 09-29-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 13
programming crontab
Hi There,
Does anyone have any ideas about editing crontab programmatically using PHP.
When a crontab file is created by a user, where does it actually live ?? Which directory ?
The crontab manual recommends NOT trying to edit the crontab file manually but by using
crontab -e.
Regards,
Steven M
- 09-29-2008 #2Just Joined!
- Join Date
- Sep 2008
- Posts
- 1
Typically they're in /var/spool/cron. You will probably need to restart cron for any changes to take effect.
-------------
Jasmine
Guaranteed ROI
- 09-30-2008 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 25
The correct way is to pull the current crontab with crontab -l save that to a file and edit it as needed then do a crontab file to put back the changed version.,
# crontab -l > /tmp/myfile
# mkchange_script /tmp/myfile.
# crontab /tmp/myfile
Now crontab is properly informed of the changes. If your inject something directly into the crontab file directly it will not get picked up unless you restart cron as well. that requires root. The check change, return can be done by anyone with cron rights.
'


Reply With Quote