SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cron & Separator

    CRON
    HTML Code:
    */2 * * * * http://xxxx.xx/ajax.php?mod=ajax_rss_import&rss_id=7&rss_code=c8fec8810828e6bf87c3o64f47f
    ERROR RECIVED:
    HTML Code:
    /bin/sh: http://xxxx.xx/ajax.php?mod=ajax_rss_import: No such file or directory

    I have set cron jobs many times in the past and never faced issues.
    For some reasons my new cron job is not working.
    This is how my cron job looks like. plz help me out guys.

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this replacing www/myfolder with the location of the php file.

    Code:
    * 2 * * * * /usr/bin/php /www/myfolder/ajax.php?mod=ajax_rss_import&rss_id=7&rss_code=c8fec8810828e6bf87c3o64f47f
    Or have the cron to run a shell script which runs php to execute one or more php files.
    intragenesis, llc professional web & graphic design

  3. #3
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    /home/httpd/vhosts/xxx.xx/subdomains/rs/httpdocs/ajax.php?mod=ajax_rss_import: No such file or directory
    Thanks but already tried that without success.
    I have & problem

  4. #4
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried escaping the & with \&

    THe other thing, set your cron to run something like "myjobs.sh"

    Then, in myjobs.sh stick in /usr/bin/php phpscripttorun.php
    intragenesis, llc professional web & graphic design

  5. #5
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow - thanks Man
    URL is not broken now but I have still this Error and News Feed is not updating properly,

    HTML Code:
    /bin/sh: http://xxx.xx/ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f0ae1561356106333gt665gt6u: No such file or directory
    HTML Code:
    /bin/sh: /home/httpd/vhosts/xxx.xx/subdomains/rs/httpdocs/ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f0ae1561356106333gt665gt6u: No such file or directory

  6. #6
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by doca View Post
    wow - thanks Man
    URL is not broken now but I have still this Error and News Feed is not updating properly,

    HTML Code:
    /bin/sh: http://xxx.xx/ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f0ae1561356106333gt665gt6u: No such file or directory
    HTML Code:
    /bin/sh: /home/httpd/vhosts/xxx.xx/subdomains/rs/httpdocs/ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f0ae1561356106333gt665gt6u: No such file or directory
    Have you tried it like this :

    * * * * * /usr/bin/php /home/httpd/vhosts/xxx.xx/subdomains/rs/httpdocs/ajax.php?mod=ajax_rss_import&rss_id=22\&rss_code=95350f0ae1561356106333gt665gt6u

    --------------------------
    I would set up your cron tab to run like this :

    * 2 * * * * /home/runphp.sh

    Then create runphp.sh in a text editor with the following contents, set it to 755 and upload it to your /home/ folder. Remember, if you edit the runphp.sh file and re-upload it, go ahead and set the permissions each time to 755.

    contents of your runphp.sh script :

    #!/bin/sh
    cd /home/httpd/vhosts/xxx.xx/subdomains/rs/httpdocs/
    /usr/bin/php ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f...


    It's good to use the cd just in case the ajax.php might write out files or tries to include() other files.

    Doing it this way, you can add additional php files to run in the runphp.sh script if you need to later and won't have to set up a different cron tab.
    intragenesis, llc professional web & graphic design

  7. #7
    SitePoint Zealot doca's Avatar
    Join Date
    Dec 2004
    Location
    Vienna, AT
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    /bin/sh: /usr/bin/php/home/httpd/vhosts/xxx.eu/subdomains/rs/httpdocs/ajax.php?mod=ajax_rss_import&rss_id=22&rss_code=95350f0ae1561356106333564cea193f: Not a directory



    Then create runphp.sh in a text editor with the following contents, set it to 755 and upload it to your /home/ folder. Remember, if you edit the runphp.sh file and re-upload it, go ahead and set the permissions each time to 755.
    I am trying to make cron job with PLESK not manually,
    because I have a lot of feeds (50 news feeds).

    I really hate plesk

  8. #8
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /user/bin/php <space> something.php
    intragenesis, llc professional web & graphic design

  9. #9
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a gander at this thread. If you have your files in the right folders and the permissions set, everything will run. Again, have the cron run a shell script where you can run multiple php scripts if need be.

    http://www.sitepoint.com/forums/show...49#post3735249
    intragenesis, llc professional web & graphic design

  10. #10
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

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