![]() |
Problem getting cron job to run and in need of help :)
The website is "infiniteresponder.mrcomptech.com".
The cron job I created is : Code:
* * * * * web14 /usr/bin/php web/sendmails.php > /dev/nullRunning this from a SSH connection as mct_infres, the ssh user for infiniteresponder.mrcomptech.com works. Code:
/usr/bin/php web/sendmails.php > /dev/nullrunning ls -l as mct_infres: Code:
dr-xr-xr-x 2 web14 client1 4096 Jul 22 20:09 binCode:
ERROR: /var/www/clients/client1/web14/bin is not owned by root:root!I thought this should be running as web14 not root, so I don't understand what is happenging here. If I try making the owner and group root:root then things just get worse. Here is the complete debug output after creating the cron job and running server.sh: Code:
23.07.2010-19:43 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lockCode:
Jul 23 19:46:01 prl-ofc-s01 jk_chrootsh[27195]: path /var/www/clients/client1/web14/dev/ is not owned by user 0 |
The path web/sendmails.php is wrong. You have to use the absolute path to the script starting with a /
Quote:
|
Is there a way to run a users cron job from the command prompt?
I changed the path in the cron job and chown the dev directory to root.
Quote:
I looked closer at the output below and can see were the system created these folders. I have four web sites for this client and only one had a cron job created for it, infiniteresonder.mrcomptech.com --> web14. And that is the only web site that has 'extra' folders in it. The other three have these folders: cgi-bin, log (symlink), ssl, tmp and web But the site that I created the cron job for has these additional folders, none of which I created: bin, dev, etc, home, lib, lib64, usr, var Working in the /var/www/clients/client1/web14/ folder - I chown on dev then it says group 0 does not own dev so I 'chgrp root dev'. Then an error in the system-log says that 'bin' is not owned by root:root, so I changed it that same way. Then yet another error for anothe "extra" folder has the same error. So all the extra folder I made the chown:chgrp root:root. After making these changes I deleted the cron job, ran server.sh, recreated the cron job ran server.sh again and this is what I got: Code:
[root@prl-ofc-s01 client1]# /usr/local/ispconfig/server/server.shCode:
usermod: unlocking the user's password would result in a passwordless account.I logged in with the ssh account created for this website and tried to run what the cron job wold run. /usr/bin/php /web/sendmails.php > /dev/null, but without the " > /dev/null" so I could see the outout and the result was: Could not open input file: /web/sendmails.php So I ran /usr/bin/php web/sendmails.php (without the beginning /), and the e-mails were immediatley delivered to my inbox. To bring things some what back to a starting point I deleted the cron job, ran server.sh then recreated the cron job with the path as 'web/sendmails.php' re-ran server.sh, other than the 'usermod' issue above the script server.sh ran correctly. Still no joy, no e-mails Waited a couple of minutes for the System-Log in ISPConfig3 to update and the erro rmessage was: Code:
path /var/www/clients/client1/web14/./home/web14 is not owned by user 5015Still no joy, so changed path in cron job to "./web/sendmails.php" Waited a about 10 minutes the checked the system log again. Error as still : Code:
Jul 24 14:46:01 prl-ofc-s01 jk_chrootsh[22223]: path /var/www/clients/client1/web14/./home/web14 is not owned by user 5015Again waiting a while for log file entries... Now in the system log: Code:
Jul 24 15:21:01 prl-ofc-s01 jk_chrootsh[23681]: now entering jail /var/www/clients/client1/web14 for user web14 (5015)Quote:
Still not getting the e-mails but if I log in via SSH as the web site user and run "/usr/bin/php web/sendmails.php" then I get 2 e-mails, I have them set to be sent every 3 minutes while testing. So, It seems that the cron job is running every minute as scheduled without errors. At least there were no errors at the command prompt when running server.sh as root just immediately after creating the cron job. And there are no errors in the ISPConfig3 System-Log. I have never seen any entries in the ISPConfig3 "ISPC Cron-Log". I edited this the cron job saved in "/etc/cron.d/ispc_chrooted_web14" to add an e-mail notification by changing MAILTO='' to MAILTO='mrcomptech@mrcomptech.com' which is the same account the autoresponder should be sending the test messages to. I have sent mail to and from this email address to both, accounts on this server and my yahoo.com e-mail account with no problems. Since making the MAILTO change the cron job has run several times as indicated by the System-Log entries: Code:
Jul 24 15:46:01 prl-ofc-s01 jk_chrootsh[24929]: now entering jail /var/www/clients/client1/web14 for user web14 (5015)But again logging in as the ssh user for this website and runing "/usr/bin/php ./web/sendmails.php" which is very similar to the cron job I get the e-mails from the autoresponder. And just to be clear the cron job is currently "/usr/bin/php /web/sendmails.php > /dev/null" for the website "infiniteresponder.mrcomptech.com" which is for client1 user web14. To help with troubleshooting - Is there a way to manually run or trigger the cron job to run while at an ssh prompt for the website user? |
Cron job appears to be missing
When logged in as root and run 'crontab -l' to list cron jobs all that is listed is:
Code:
* * * * * /usr/local/ispconfig/server/server.sh &> /dev/nullCode:
no crontab for web14Code:
now entering jail /var/www/clients/client1/web14 for user web14 |
Cron jobs don't run even when logged in ssh as website user.
I tried creating the cron job after logging in as the website user.
crontab -e created job Code:
* * * * * /usr/bin/php ./web/sendmails.php > /dev/nullCode:
Could not open input file: ./web/sendmails.phpCode:
* * * * * /usr/bin/php /web/sendmails.php > /dev/nullCode:
Could not open input file: /web/sendmails.phpCode:
/usr/bin/php /web/sendmails.phpCode:
Could not open input file: /web/sendmails.phpCode:
/usr/bin/php ./web/sendmails.phpAny help on getting cron jobs configured under ISPConfig3 would be greatly appreciated! |
Normally you run such a sendmail.php file like this as cronjob:
/usr/bin/wget http://www.yourdomain.com/sendmail.php and not with the commandline php interpreter which might be unavailable in the jailed cron enviroment. |
Solved - Problem getting cron job to run and in need of help
The cron job:
* * * * * /usr/bin/wget http://infiniteresponder.mrcomptech.com/sendmails.php does work! Thank You!!!!!!! I thought wget was just an ftp program and thought that after wget downloaded the file then it needs a command processor, in this case since wget is downloading a php script the command processor would be /usr/bin/php. I don't understand why this works, but it would seem that wget must be more than just an FTP program and has support for php. In the meantime I had create this cron job, which does work or course but it is being run as root. * * * * * /usr/bin/php /var/www/infiniteresponder.mrcomptech.com/web/sendmails.php > /dev/null I prefer putting the cron job in the 'Sites' tab since it's a convenient place to put all cron jobs. Thanks again Till! |
Quote:
|
| All times are GMT +2. The time now is 11:42. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.