Cronjob every minute

后端 未结 5 1905
遇见更好的自我
遇见更好的自我 2020-12-18 18:42

I have a file in mysite.com/url1/url2/cronjob.php which has to be run every minute. I try every combination, but can\'t succeed. What should I run in command line? Thank you

相关标签:
5条回答
  • 2020-12-18 19:23

    Steps your shell

    $ crontab -e
    
    
    * * * * * php -f /path/to/cron.php
    ~
    ~
    
    0 讨论(0)
  • 2020-12-18 19:23

    I got confused for the first time where to add all of these and finally found.

    Type the following in the linux/ubuntu terminal

     crontab -e 
    

    select an editor (sometime it asks for the editor) and this to run for every minute

    *       *       *       *       *       /usr/bin/php path/to/cron.php &> /dev/null
    
    0 讨论(0)
  • 2020-12-18 19:40

    In case you'd set it up in a crontab, this works:

    */1 * * * * /usr/bin/wget -O /dev/null http://example.com/cron.php
    
    0 讨论(0)
  • 2020-12-18 19:41

    The PHP interpreter.

    /[path-to-php]/php -f [your-php-script]
    
    0 讨论(0)
  • 2020-12-18 19:43

    Are you looking for help to make an UNIX cronjob?

    If so, have you tried to edit /etc/crontab, and add

    \1 * * * * user command
    

    where user is either root or your name. Im not exactly sure how to access and URL, but a dirty way could involve downloading the link as a file, e.g. "wget http://url.com/page.php"

    0 讨论(0)
提交回复
热议问题