exp:installcrontab
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
Show, add or remove the cron job of the installation: the crontab lines that run its cronjob parts (--add and --remove: dry run unless --apply)
Usage
./console exp:installcrontab [options] php bin/php/installcrontab.php [options]
Help
The output of ./console help exp:installcrontab (the script run with --help), without the standard options:
Usage: bin/php/installcrontab.php [OPTION]...
Show, add or remove the cron job of this installation: the crontab lines that run its cronjob
parts (runcronjobs.php) with the PHP binary and the siteaccess each needs, in the crontab of the
system user that owns the installation directory, between the lines
"# BEGIN Exponential cronjobs: <root>" and "# END Exponential cronjobs: <root>".
The parts are cronjob.ini [CrontabSettings] Parts[] that the installation defines (an extension's
when it is active), the schedules [AdminSettings] CrontabSchedule_<part>. --add replaces the block
or appends it and keeps every other line; a part another line of the crontab runs already is left
out. Run it as the owner of the installation or as root (crontab -u <owner>); otherwise, or without a
crontab command, it prints the lines to add by hand. Prints PASS or FAIL at the end.
--add and --remove change nothing without --apply: they show the block and the lines of the crontab
that would change. --dry-run is still accepted and means the same as no flag; --apply together with
--dry-run is a usage error (exit 2).
Example: php bin/php/installcrontab.php --show
php bin/php/installcrontab.php --add
php bin/php/installcrontab.php --add --apply
php bin/php/installcrontab.php --remove --apply
Options:
--apply With --add or --remove: write the crontab (the default shows what would change)
--dry-run The default, kept for scripts that pass it: show what would change, change nothing
--show The planned lines, the block in the crontab and the last runs (the default)
--add Add or update the block
--remove Remove the block
--admin-siteaccess=VALUE The siteaccess of the admin parts (default: [CrontabSettings] AdminSiteAccess, else admin)Options
| Option | Value | Description |
|---|---|---|
| --apply | - | With --add or --remove: write the crontab (the default shows what would change) |
| --dry-run | - | The default, kept for scripts that pass it: show what would change, change nothing |
| --show | - | The planned lines, the block in the crontab and the last runs (the default) |
| --add | - | Add or update the block |
| --remove | - | Remove the block |
| --admin-siteaccess | required | The siteaccess of the admin parts (default: [CrontabSettings] AdminSiteAccess, else admin) |
Standard options
Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.
Source
bin/php/installcrontab.php, kernel/private/classes/commands/installcrontab.php
See also
Generated example: exp:installcrontab
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment