Koozali.org: home of the SME Server
Contribs.org Forums => General Discussion => Topic started by: jklapp on March 26, 2008, 02:12:35 AM
-
I'm having a couple of big problems with cron... I setup a cron to run a script and this is what I keep getting in my mail box... (Of course I edited the server name :)
Cron <root@servernamer> http://www.domainname.com/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528
/bin/bash: http://www.domainname.com/smf/index.php?module=tRSSNews: No such file or directory
I don't know why it's not working, the command line is correct... but this part is really strange... I deleted it in server-manager, but I keep getting the same error message in my mail box??? (the message comes every minute) Any thoughts???
Thanks :)
-
Could you provide more info? If you can give the crons, I may be able to help you check it.
Please provide your custom templates from:
/etc/e-smith/templates-custom/etc/cron.d
-
I do not have a "cron.d" in ... /etc/e-smith/templates-custom/etc/ ... all there is "/home"
But I do have ... /etc/e-smith/templates/etc/cron.d... but all that is there is "/claymav" and that files is dated Aug 19,2005
Now I do have a /etc/cron.d and the files in there are - "claymav" - "purge_junkmail" - "smolt" - "warnquota" but all those files has old dates on them too.
-
I did get the emails to stop.. After removing the cron from server-manager I had to run these commands at shell
/sbin/e-smith/expand-template /etc/crontab
service crond restart
Apparently the commands I entered into the cron server-manager was not correct... (Although the command does work from a web browser) .... Which brings up a very good question.... How should commands be entered??
I tried....
http://www.servername.com/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528
and I've tried the location on the server
/home/e-smith/files/ibays/directory/html/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528
I've even tried to start with "home" - "/e-smith" - "e-smith" - "/files" and I still get...
/bin/bash: "WHAT EVER PATH I USE" ( No such file or directory )
I've even tried... /usr/bin/php -q home/e-smith/files/ibays/directory/html/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528
But I get "No input file specified"
-
I'm having a couple of big problems with cron... I setup a cron to run a script and this is what I keep getting in my mail box... (Of course I edited the server name :)
Perhaps you can try and explain what you are trying to achieve. To me it looks like you try to retrieve a URL from the bash shell/SME Server shell by entering the URL only. You probably receive an error as the shell is not able to interpret URLs, it has no way to handle it as it does not know what it is, you need extra programs for that.
I don't know why it's not working, the command line is correct...
It seems to me that your cron job is nothing more than a bash command, so everything you add in the bash file should also work from the SME server shell, did you actually try the command from the SME Server shell succesfully?
It would help if you would show us the code of the cronjob script as I have serious doubts that what you are doing is correct and should work like you state.
but this part is really strange... I deleted it in server-manager, but I keep getting the same error message in my mail box???
I do not know of any option to create cron jobs on stock SME Server, did you perhaps install a contrib that implements this?
(the message comes every minute) Any thoughts???
You probably set up the cron job to run every minute, as it fails every minute it will send you a mail every minute.
-
Apparently the commands I entered into the cron server-manager was not correct...
The is no 'cron' page in server-manager.
I tried....
http://www.servername.com/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528
Ah, I see that you are trying to periodically access a URL, in order to activate some code in 'smf'. You could try:
wget -O /dev/null 'http://www.servername.com/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528'
I have some doubts that the 'key' parameter will stay valid, however. I suspect it's a session identifier, and will time out.
You're taking a rather unusual approach to this problem, whatever it is.
-
There is no 'cron' page in server-manager.
Yes there is :) ... Check out http://wiki.contribs.org/Crontab_Manager
Ah, I see that you are trying to periodically access a URL, in order to activate some code in 'smf'. You could try:
wget -O /dev/null 'http://www.servername.com/smf/index.php?module=tRSSNews;sa=updatecache;func=cron;key=77a6dc1ac9364528'
I have some doubts that the 'key' parameter will stay valid, however. I suspect it's a session identifier, and will time out.
You're taking a rather unusual approach to this problem, whatever it is.
Your code work !!!Thank you :) ... I am though having a problem with that cron page in server-manager... I set it to update once a day and it's updating every minute. :(
-
Yes there is :) ... Check out http://wiki.contribs.org/Crontab_Manager
That is a contrib - it is not part of SME server.
I set it to update once a day and it's updating every minute. :(
I am quite sure that you have it set to update every minute. That's either your error, or it's a bug in the Crontab_Manager contrib. If you find it is the latter, then file a bug report against the contrib via the Bug Tracker.
-
Thanks a lot.
For a number of years I have had a file in the /etc/cron.hourly directory on the sme server and other Linux distroes.
It has been used to update a dynamic dns address with a file content like this: wget 'http://example.com/opdat.php'
It has worked all the time, but it has produced entries in the root directory that from time to time have had to be flushed out.
The only trix is to set the user rights for the file so that the file can be executed.
I guess the this small mod: "-O /dev/null" will mean something like "send output to device zero" and no more cleaning of the root directory.
I think that the most easy way to set up a cron job on most distroes is to just make a file with the cron job in the /etc/cron.hourly or the /etc/cron.daily directory.
Don't know if it is a recomended sme practice, but it har never given any problems (except for until now all the entries in the root directory.)
It's a okay and simple way to do it, is'n it ? (and the root user should be a ok file owner ?)
-
Works - Updates every hour and no more entries in the /root directory.