I'm trying to get cron to run cv.

Putting this in crontab:

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


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



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


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

| improve this answer | |
  • 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

Only path, not php-file nor webroot:

*/5 * * * * cv api job.execute --user=harrumph --cwd=/var/www/html/wordpress/wp-content/uploads/civicrm

| improve this answer | |

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.