Bash squeaking sequence php



  • 0 13 * * * /usr/bin/fsock -n /tmp/rrr.lock -c "/var/www/admin/www/test.ru/bitrix/script.sh >> /tmp/eshop-amount-import.log 2>&1"
    

    file

     #!/bin/bash
    

    /usr/bin/php /var/www/admin/www/test.ru/bitrix/script.php
    /usr/bin/php /var/www/admin/www/test.ru/bitrix/script2.php

    script.php

    #!/usr/bin/php
    <?

    echo "hello_world";
    echo date('Y-m-d H:i:s');

    ?>

    and script2.php in the log.

    #!/usr/bin/php
    <?

    set_time_limit(0);
    ini_set('display_errors', E_ALL);
    ini_set('memory_limit', '1024M');

    echo "hello_world222222222222";
    echo date('Y-m-d H:i:s');

    ?>

    Why don't two scruples go to echo. They should be consistently implemented.


  • QA Engineer

    You've got a seal on the commande launch. That's it.

    /usr/bin/flock
    

    And you have fsock In the crown. And see if you're worth it. flock:

    which flock
    

    And redirect. STDOUT and STDERR Better than ever. flock For example:

    0 13 * * * /usr/bin/flock -n /tmp/rrr.lock -c '/var/www/admin/www/test.ru/bitrix/script.sh' >> /tmp/eshop-amount-import.log 2>&1
    

    UPD

    Why are you launching scruples indicating a complete path to /usr/bin/phpif the first line of the violators themselves already shows the full path to the interpreter. #!/usr/bin/php? Suffice to give launch rights, and you can start this:

    $ chmod g+x /var/www/admin/www/test.ru/bitrix/script.php
    $ ./var/www/admin/www/test.ru/bitrix/script.php
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2