Install the latest version for global usage with
$ composer global require oudirichi/scheduler
or per project
$ composer require oudirichi/scheduler
$ cd /apps/my-great-project
# for global
$ shedulerize
# for specific project
$ vendor/bin/shedulerize
This will create an initial config/schedule.php
file for you.
$ cd /apps/my-great-project
$ scheduler
This will simply show you your schedule.rb file converted to cron syntax. It does not read or write your crontab file; you'll need to do this in order for your jobs to execute:
$ scheduler --update-crontab
<?php
Scheduler\job_type("pewpew", "cd :path && :task");
Scheduler\every("* * * * *", function($cron) {
$cron->pewpew('echo "pewpew" >> log/test.log');
});
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 0-6 OR 1-7, 0 and 7 both stand for Sunday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)