We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Cron job problem ...
Cron job problem ...
Hi,
Maybe someone of you could help me with this issue. I do not know much about server administration but I managed to install VestaCP to my VPS server (Ubuntu 14.04) by myself. My web shop needs to do cron job every minute but when I created cron job in VestaCP it run this cron job every 16th minute twice.
cron job I created is:
/usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
-> so, my crontabs/admin file (/var/spool/cron/crontabs/admin) looks like this:
MAILTO=[email protected]
15 02 * * * sudo /usr/local/vesta/bin/v-update-sys-queue disk
10 00 * * * sudo /usr/local/vesta/bin/v-update-sys-queue traffic
30 03 * * * sudo /usr/local/vesta/bin/v-update-sys-queue webstats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-queue backup
10 05 * * * sudo /usr/local/vesta/bin/v-backup-users
20 00 * * * sudo /usr/local/vesta/bin/v-update-user-stats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-rrd
* * * * * /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
this cron.php file in encrypted and I had to install ionCube Loader to my server
Access Log looks like this
XXX.XXX.XXX.XXX - - [14/Jan/2015:19:50:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:19:50:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:06:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:06:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:22:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:22:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
...
Otherwise all seems to be good and shop runs ok.
Thanks,
Maybe someone of you could help me with this issue. I do not know much about server administration but I managed to install VestaCP to my VPS server (Ubuntu 14.04) by myself. My web shop needs to do cron job every minute but when I created cron job in VestaCP it run this cron job every 16th minute twice.
cron job I created is:
/usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
-> so, my crontabs/admin file (/var/spool/cron/crontabs/admin) looks like this:
MAILTO=[email protected]
15 02 * * * sudo /usr/local/vesta/bin/v-update-sys-queue disk
10 00 * * * sudo /usr/local/vesta/bin/v-update-sys-queue traffic
30 03 * * * sudo /usr/local/vesta/bin/v-update-sys-queue webstats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-queue backup
10 05 * * * sudo /usr/local/vesta/bin/v-backup-users
20 00 * * * sudo /usr/local/vesta/bin/v-update-user-stats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-rrd
* * * * * /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
this cron.php file in encrypted and I had to install ionCube Loader to my server
Access Log looks like this
XXX.XXX.XXX.XXX - - [14/Jan/2015:19:50:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:19:50:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:06:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:06:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:22:01 +0100] "GET /cron.php HTTP/1.0" 301 521 "-" "Wget/1.15 (linux-gnu)"
XXX.XXX.XXX.XXX - - [14/Jan/2015:20:22:01 +0100] "GET /cron.php HTTP/1.0" 200 263 "-" "Wget/1.15 (linux-gnu)"
...
Otherwise all seems to be good and shop runs ok.
Thanks,
Re: Cron job problem ...
Hello,
witch ssh access your user has? Can he use wget without sudo? Please add sudo and check again.
or you can another way, why can't we get cron via php? Like this:
/usr/bin/php /home/user/web/userdomain/public_html/cron.php
witch ssh access your user has? Can he use wget without sudo? Please add sudo and check again.
or you can another way, why can't we get cron via php? Like this:
/usr/bin/php /home/user/web/userdomain/public_html/cron.php
Re: Cron job problem ...
What does that "which ssh access your user has?" means?
I tried earlier today sudo -> sudo /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
-> I got email notification every minute:
sudo: no tty present and no askpass program specified
I also tried earlier -> /usr/bin/php -q /home/admin/web/userdomain/public_html/cron.php
-> I got email notification every minute:
Site error: the file <b>/home/admin/web/userdomain/public_html/cron.php</b> requires the ionCube PHP Loader ioncube_loader_lin_5.5.so to be installed by the website operator. If you are the website operator please use the <a href="http://www.ioncube.com/lw/">ionCube Loader Wizard</a> to assist with installation.
When I contact to this application support they said that "We need to set the cron job using wget command and not by /usr/bin/php" ... and asked to contact hosting support.
I can also run manually this cron.php whenever I want by visiting web page mydomain.com/cron.php and it works.
I tried earlier today sudo -> sudo /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
-> I got email notification every minute:
sudo: no tty present and no askpass program specified
I also tried earlier -> /usr/bin/php -q /home/admin/web/userdomain/public_html/cron.php
-> I got email notification every minute:
Site error: the file <b>/home/admin/web/userdomain/public_html/cron.php</b> requires the ionCube PHP Loader ioncube_loader_lin_5.5.so to be installed by the website operator. If you are the website operator please use the <a href="http://www.ioncube.com/lw/">ionCube Loader Wizard</a> to assist with installation.
When I contact to this application support they said that "We need to set the cron job using wget command and not by /usr/bin/php" ... and asked to contact hosting support.
I can also run manually this cron.php whenever I want by visiting web page mydomain.com/cron.php and it works.
Re: Cron job problem ...
247x wrote:What does that "which ssh access your user has?" means?
If it's "no login", then try change this to bash
ok, I see, forget about sudo - you run this command, but user not in sudoers.247x wrote:I tried earlier today sudo -> sudo /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php
-> I got email notification every minute:
sudo: no tty present and no askpass program specified
Re: Cron job problem ...
You don't need root privileges to run wget.
Remove the sudo.
Remove the sudo.
Re: Cron job problem ...
That's what I have done and now cron job runs every 16th minute for some reason which I can not figure out why ...sim wrote:You don't need root privileges to run wget.
Remove the sudo.
-> I have set it to run every minute ...
* * * * * /usr/bin/wget -O /dev/null -q http://mydomain.com/cron.php