2017-01-09 17:58:44 +01:00
|
|
|
Run builds using cronjob
|
|
|
|
========================
|
2016-07-19 11:12:28 +02:00
|
|
|
|
2017-01-20 14:05:25 +01:00
|
|
|
Running builds using cron is a quick and simple method of getting up and running with PHP Censor. It also removes the
|
|
|
|
need for PHP Censor to be running all the time.
|
2016-07-17 16:20:35 +02:00
|
|
|
|
2016-07-19 11:12:28 +02:00
|
|
|
Setting up the Cron Job
|
2017-01-04 13:22:20 +01:00
|
|
|
-----------------------
|
2016-07-17 16:20:35 +02:00
|
|
|
|
2016-07-19 13:05:02 +02:00
|
|
|
You'll want to set up PHP Censor to run as a regular cronjob, so run `crontab -e` and enter the following:
|
2016-07-17 16:20:35 +02:00
|
|
|
|
|
|
|
```sh
|
2017-01-09 17:58:44 +01:00
|
|
|
SHELL=/bin/bash
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
|
|
|
|
* * * * * /path/to/php-censor/bin/console php-censor:run-builds
|
2016-07-17 16:20:35 +02:00
|
|
|
```
|
|
|
|
|
2017-01-09 17:58:44 +01:00
|
|
|
And for one running worker:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
SHELL=/bin/bash
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
|
|
|
|
* * * * * flock -n /tmp/run-builds.lock --command '/path/to/php-censor/bin/console php-censor:run-builds'
|
|
|
|
```
|