1

I'm trying to get cron to run cv.

Putting this in crontab:

*/5 * * * * /usr/local/bin/cv api job.execute --user=harrumph

produces...

Failed to locate civicrm.settings.php. By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php. Symlinks and multisite configurations may interfere. To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php.

The correct path to civicrm.settings.php is

/var/www/html/wp-content/uploads/civicrm/civicrm.settings.php

SO...

How am I supposed to use EXPORT in crontab so as to point cv to where it should be looking?

2

You can use the --cwd option for cv to set a current working directory:

*/5 * * * * /usr/local/bin/cv --cwd=/var/www/html/ api job.execute --user=harrumph

  • Problem there is, this produces an error [Symfony\Component\Console\Exception\RuntimeException] The "--cwd" option does not exist. – Harrumph Sep 17 '18 at 17:23
  • Do you happen to have an older version of cv? The option was added somewhat recently: github.com/civicrm/cv/pull/38 – Thomas Schüttler Sep 20 '18 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.