Skip to content

Commit

Permalink
[doc] prefix "bin/console" with php (fixes #14)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Jul 16, 2020
1 parent bd2bbf7 commit bc6bccd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
[![CI](https://github.com/zenstruck/schedule-bundle/workflows/CI/badge.svg)](https://github.com/zenstruck/schedule-bundle/actions?query=workflow%3ACI)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/zenstruck/schedule-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/zenstruck/schedule-bundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/zenstruck/schedule-bundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/zenstruck/schedule-bundle/?branch=master)
[![Latest Version](https://img.shields.io/packagist/v/zenstruck/schedule-bundle.svg)](https://packagist.org/packages/zenstruck/schedule-bundle)
[![Total Downloads](https://img.shields.io/packagist/dt/zenstruck/schedule-bundle.svg)](https://packagist.org/packages/zenstruck/schedule-bundle)

Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony
application. Most applications have jobs that need to run at specific intervals.
This bundle enables you to define these jobs in your code. Job definitions (tasks)
are version controlled like any other feature of your application. A single Cron
entry (`bin/console schedule:run`) on your server running every minute executes due
entry (`php bin/console schedule:run`) on your server running every minute executes due
tasks.

The inspiration and some of the API/code for this Bundle comes from [Laravel's
Expand Down Expand Up @@ -108,13 +110,13 @@ $ composer require zenstruck/schedule-bundle
2. List your tasks to diagnose any problems:

```console
$ bin/console schedule:list
$ php bin/console schedule:list
```

3. Add the following Cron job on your server running every minute:

```
* * * * * cd /path-to-your-project && bin/console schedule:run >> /dev/null 2>&1
* * * * * cd /path-to-your-project && php bin/console schedule:run >> /dev/null 2>&1
```

See [Defining the Schedule](doc/define-schedule.md) and [Defining Tasks](doc/define-tasks.md)
Expand Down
20 changes: 10 additions & 10 deletions doc/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Assuming the bundle has no other configuration, running `schedule:list` shows th
following output (exit code `1`):

```
$ bin/console schedule:list
$ php bin/console schedule:list
2 Scheduled Tasks Configured
============================
Expand Down Expand Up @@ -82,7 +82,7 @@ $ bin/console schedule:list
Running with the `--detail` flag outputs the following (exit code `1`):

```
$ bin/console schedule:list --detail
$ php bin/console schedule:list --detail
2 Scheduled Tasks Configured
============================
Expand Down Expand Up @@ -147,7 +147,7 @@ zenstruck_schedule:
Running now outputs the following (exit code `0`):

```
$ bin/console schedule:list
$ php bin/console schedule:list
2 Scheduled Tasks Configured
============================
Expand All @@ -173,7 +173,7 @@ $ bin/console schedule:list
Running with the `--detail` flag outputs the following (exit code `0`):

```
$ bin/console schedule:list --detail
$ php bin/console schedule:list --detail
2 Scheduled Tasks Configured
============================
Expand Down Expand Up @@ -238,14 +238,14 @@ Help:

Add this command as a Cron job to your production server(s) running every minute:

* * * * * cd /path-to-your-project && bin/console schedule:run >> /dev/null 2>&1
* * * * * cd /path-to-your-project && php bin/console schedule:run >> /dev/null 2>&1
```
This is the command that runs currently due tasks. It should be added as a Cron
job to your production server(s) running every minute:
```
* * * * * cd /path-to-your-project && bin/console schedule:run >> /dev/null 2>&1
* * * * * cd /path-to-your-project && php bin/console schedule:run >> /dev/null 2>&1
```
The above Cron job sends the command output to `/dev/null` but the command does
Expand All @@ -256,7 +256,7 @@ the tasks is due at time of run, and the it ran successfully, the command will
output the following (exit code `0`):
```
$ bin/console schedule:run
$ php bin/console schedule:run

// Running 1 due task. (2 total tasks)

Expand All @@ -272,7 +272,7 @@ Running the command with the verbose flag (`-v`) displays task output
(exit code `0`):
```
$ bin/console schedule:run -v
$ php bin/console schedule:run -v

// Running 1 due task. (2 total tasks)

Expand Down Expand Up @@ -305,7 +305,7 @@ Assuming the due task failed, the command will output the following
(exit code `1`):
```
$ bin/console schedule:run
$ php bin/console schedule:run

// Running 1 due task. (2 total tasks)

Expand All @@ -321,7 +321,7 @@ Again, assuming the due task failed, the command with the verbose flag
(`-v`) displays task output (exit code `1`):
```
$ bin/console schedule:run -v
$ php bin/console schedule:run -v

// Running 1 due task. (2 total tasks)

Expand Down
2 changes: 1 addition & 1 deletion doc/run-schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ should be added to your production server's
[crontab](http://man7.org/linux/man-pages/man5/crontab.5.html):

```
* * * * * cd /path-to-your-project && bin/console schedule:run >> /dev/null 2>&1
* * * * * cd /path-to-your-project && php bin/console schedule:run >> /dev/null 2>&1
```

## Symfony Cloud
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ScheduleRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure(): void
Add this command as a Cron job to your production server(s) running every minute:
* * * * * cd /path-to-your-project && bin/console schedule:run >> /dev/null 2>&1
* * * * * cd /path-to-your-project && php bin/console schedule:run >> /dev/null 2>&1
EOF
)
;
Expand Down

0 comments on commit bc6bccd

Please sign in to comment.