exp:installcrontab
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).
Script bin/php/installcrontab.php, code in kernel/private/classes/commands/installcrontab.php. Run it from the installation root, as the user the web server runs as:
./console exp:installcrontab --help
php bin/php/installcrontab.php --helpHelp text
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 --applyOptions
| Option | Value | Help |
|---|---|---|
--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) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/installcrontab.php, kernel/private/classes/commands/installcrontab.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.