How to successfully run drush commands from crontab?

[view:googlead_ia1]

After trying for a couple of hours to run cron from crontab I finally managed to make it. System logs helped me with that.

So, long story short, you need to add environment path in your cron table first line (cron commands run one after anonther). Like this:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Because I have drush in /usr/local/bin, I need to specifically add that in my path env. Also, you need to add the path where php binary file is.

To find out where a file is, just type which your-bin-file-here. Eg. which drush will give me /usr/local/bin/drush. Or which php gives me /usr/local/bin/php

Now your system cron will smoothly run every drush command.

LĂSAȚI UN MESAJ

Vă rugăm să introduceți comentariul dvs.!
Introduceți aici numele dvs.
Captcha verification failed!
Scorul utilizatorului captcha a eșuat. va rog sa ne contactati!

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.

- Advertisement -spot_img
Noutăți

Articole similare

- Advertisement -spot_img