dev-master
9999999-devGenerates a crontab based on the app directory.
MIT
The Requires
- symfony/console ^2.3|^3.0|^4.0
- symfony/framework-bundle ^2.3|^3.0|^4.0
- symfony/process ^2.3|^3.0|^4.0
- symfony/yaml ^2.3|^3.0|^4.0
The Development Requires
Generates a crontab based on the app directory.
An easy way to generate a crontab based on the application path., (*1)
Unlike similar Symfony bundles, this one does not provide a worker, it actually replaces the user's crontab., (*2)
⚠️ Do not use this if your user's crontab may by altered by another process!, (*3)
[!IMPORTANT]
This repository is no longer maintained and may be removed in a near future. You may consider creating a fork if you still require it., (*4)
This bundle is compatible with Symfony 4/5+. Use 0.1.*
tag for earlier versions compatibility., (*5)
composer require bentools/crontab-bundle 0.2.*
With Symfony Flex, you're already done!, (*6)
Create a sample crontab in config/crontab.dist
:, (*7)
# config/crontab.dist 0 0 * * * php {%kernel.project_dir%}/bin/console your:favorite:command
As you can see, {%kernel.project_dir%}
is a container parameter.
It will be replaced at runtime with its current value. You can use any container parameter wrapped with curly braces., (*8)
This will give you a preview of your crontab:, (*9)
php bin/console crontab:update --dry-run --dump
To apply your crontab, run this:, (*10)
php bin/console crontab:update
Now if you execute crontab -l
in your shell you should see something like this:, (*11)
0 0 * * * php /home/me/my-project/bin/console your:favorite:command
Yes., (*12)
config/crontab.dist
. Can I change that?Sure: create a config/packages/bentools_crontab.yaml
and change the dist_file
parameter:, (*13)
bentools_crontab: dist_file: '%env(CRONTAB_SAMPLE_FILE)%' # That's an example.
--no-interaction # Skip confirmation question --dry-run # Do not update crontab for real --output-file=/path/to/generated_crontab # Change output file (which is a tmp file by default) --dump # Show generated crontab content
Yes. Use this bundle only if you consider it to be the only crontab entry point., (*14)
./vendor/bin/pest
MIT, (*15)
Generates a crontab based on the app directory.
MIT