Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2387

Improve the cron command listed under system automation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.2.0-b1
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      Under Settings > System > Automation, the path to PHP is hard coded as /usr/bin/php but this is not always the correct path to PHP. Additionally, the command does not currently direct the output to /dev/null, so it may result in emails being generated by the cron.

      There is a constant called PHP_BINDIR which should show the path to the directory. For example, if PHP is in /usr/bin/php, it should return /usr/bin and we can append "/php". See http://php.net/manual/en/reserved.constants.php

      There is another constant called PHP_BINARY which is suppose to show the full path in PHP 5.4+, but it returned nothing in my tests.

      So, this may not be a foolproof way to determine the path to PHP, but it's better than always assuming it's /usr/bin/php

      Additionally, " >/dev/null 2>&1" should be appended to the end of the cron command.

        Activity

        admin Paul Phillips created issue -
        admin Paul Phillips made changes -
        Field Original Value New Value
        Attachment capture-for-jira-screenshot-20170517-100341-645.png [ 11631 ]
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        PHP_BINARY is set at run time
        PHP_BINDIR is set at compile time

        Since php does not have to be located in the place it was compiled, we would have to look at PHP_BINARY if we were to try to determine this path.

        Show
        tyson Tyson Phillips (Inactive) added a comment - PHP_BINARY is set at run time PHP_BINDIR is set at compile time Since php does not have to be located in the place it was compiled, we would have to look at PHP_BINARY if we were to try to determine this path.
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        tyson Tyson Phillips (Inactive) made changes -
        Fix Version/s 4.2.0-b1 [ 11014 ]
        Fix Version/s Short Term [ 10800 ]
        tyson Tyson Phillips (Inactive) made changes -
        Story Points 2
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.2.0 Sprint 1 [ 46 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.2.0 Sprint 1 [ 46 ] 4.2.0 Sprint 1, 4.2.0 Sprint 2 [ 46, 47 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        Automated transition triggered when Jonathan Reissmueller created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        jonathan Jonathan Reissmueller made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 2 hours, 24 minutes [ 8640 ]
        Worklog Id 10377 [ 10377 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 2 hours, 24 minutes [ 8640 ] 2 hours, 34 minutes [ 9240 ]
        Worklog Id 10377 [ 10377 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 2 hours, 34 minutes [ 9240 ] 3 hours, 30 minutes [ 12600 ]
        Worklog Id 10381 [ 10381 ]
        Automated transition triggered when Jonathan Reissmueller created pull request #338 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 3 hours, 30 minutes [ 12600 ] 3 hours, 56 minutes [ 14160 ]
        Worklog Id 10414 [ 10414 ]
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.2.0 Sprint 1, 4.2.0 Sprint 2 [ 46, 47 ] 4.2.0 Sprint 1, 4.2.0 Sprint 2, 4.2.0 Sprint 3 [ 46, 47, 48 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        Automated transition triggered when Tyson Phillips (Inactive) merged pull request #338 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              5/Dec/17

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 hours, 56 minutes
              3h 56m

                Agile