Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    13

    Thumbs down 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

  2. #2
    Just 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

  3. #3
    Just 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.




    '

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...