• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Cronjobs don´t work

SteffB

New Pleskian
I have migrated form 9.5 to 11.

My problem now is that the following script don´t work as cronjob entry

cd /var/www/vhosts/DOMAIN/httpsdocs/PATH/ && /usr/bin/php -q SCRIPTNAME.php

I do the CD before to run in this directory so relativ inclusion works.
It worked unter 9.5.

I did the following tests:

- Run script on consol as Admin > Works
- Run Script on consol with SU user that run the script under cron > Worked
- Check different SSH settings > No change
- Look at the /var/log/cron logs > No entrys
- Look at crontab -l > Only the ntp timesync job get listed

Any Idea where I could find some informations on the server it the scripts are running and if what the problem could be?
 
Very strange! Your command is correct and should work. I guess you're running this as root? (at least you tried and it was working).

I've made test ".php" file and i wrote there to append some text in file, and that was also working in shell, but firstly when i put that into cron, it was not working. Why? Because of timezone....maybe you have the same problem...

So on server, e.g. now is:
# date
Wed Jan 2 12:35:14 GMT 201

and in my country is "13:35" (which means i'm GTM +1). That also means if i setup cron to run at "12:36", my cron will run tomorrow (or how ever i specified it to run), i have to setup this to run in my timezone, so I've setuped later cron to run in my timezone "13:37" (my timezone) - leet time! and yes...it is working.
 
That could have bene a hint.. but the job runs every 5 minutes ;) So the timezone should not worry.

I have the suspicion that the crons that i did over the interface just dont run because of some reason. Thats why I asked if there is a way to test his.

Thanks for your reply
 
Can you please post output of (as root or for which user is this specified):
# crontab -l
(just to make sure)

There is way to test it and you did it :)
 
Thanks for helping. As wirtten I get only the ntp job.

- Look at crontab -l > Only the ntp timesync job get listed

47 23 * * * /usr/sbin/ntpdate -b -s ptbtime1.ptb.de
 
Then this crontab is not run by root user. Oh well, do you have skype or something? Contact me, i can take a look on this if you want - my skype name is "mislav.orsolic" (Varazdin, HR) or email mislav@fedsrv.com

In addition you can run following:
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

- you will get list of all cronjobs/users on server and you will know for which user you've setuped this cron (in case you don't know), once you have users name, you can check his cronjobs by running
# crontab -u <NAME_OF_USER> -l
(crontab -l is by default only for root) - if nothing is displayed, there are no crons for this user
 
Last edited:
Would be nice but Its a company server. So I can not just let someone have a look :(
Is known how Plesk configures the crons: Perhaps i can have a look in the user folder?
 
I manage few company servers, no worries. I'm not EVIL dude, and i wouldn't even requested shell details to just connect there, only way i would do is through program Team Viewer.
 
I am a step further :)

If I change the user with SU user and do then a crontab -e
I get my cron. But it dont run.
For test i added now the cron line to root > crontab-e and it works.

Any Idea why the server don´t run the cronjobs of this user?
 
Back
Top