Wondering if it's possible programmatically to trigger a cron job which is scheduled in the future?. This way i can prevent site admins from having access to the crontab admin page.

Comments

ramlev created an issue. See original summary.

arnested’s picture

Hej Hasse!

You can trigger it via drush:

$ drush cron-run --help
This command will run a cron job

Eksempler:
 drush cron-run node_cron                  Run the node_cron job
 drush cron-run --options=thread=1         Run all scheduled jobs and instruct serial launcher only to launch thread 1 jobs

Parametre:
 name                                      Job to run

Valg:
 --check-schedule                          Checks the schedule when running a single job. The opposite of --force but for a single job only
 --force                                   Only effective when cron-run is run without any arguments. This options skip the schedule check for each job. Locks are still respected. This option is a
                                           synonom for --options=bypass_schedule
 --options                                 Custom options for plugins, e.g. --options=thread=1 for serial launcher

Aliases: cr

Otherwise you can just call the hook_cron() implementation directly.

ramlev’s picture

Awesome Arne - Takker :)

arnested’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.