Thread: Cron problem

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Cron problem


    hello,

    I want to add a cron to execute some php files at every minute for this i have add

    52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /home/.sites/data/cron.monthly )

    to /etc/crontab

    /home/.sites/data/cron.monthly consist one executable which executes all php files one by one

    Is it a right way of adding cronjob

    Thanks
  2. #2
  3. life isn't we think of it
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2003
    Location
    Kiev
    Posts
    2,027
    Rep Power
    55
    I would recommend to use crontab application.

    This is how you edit cronjobs:
    Code:
    crontab -e
    And to list them, issue this command:
    Code:
    crontab -l
    PS This is not PHP question, but Linux one.
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,870
    Rep Power
    6351
    Welcome to DevShed amarpol1305, I've moved your thread to the Linux Help forum. Even though you're trying to run a PHP script, you don't have a PHP problem, you have a crontab problem (as your thread title aptly shows).

    -Dan
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo