Hi,
I'm running a crontjob on CentOS 5.2 server, which then connects to a webpage to run some stuff. It has to run this way, since the webpage is on a Windows server, and the Windows scheduled tasks doesn't work as well.
It seems like the cronjob is working fine, except that the email output worries me a bit.
This is what I get on email,
Your Terminal type is unknown!
Enter a terminal type: [vt100] TERMINAL TYPE IS SET TO vt100 (B)0[1;24r[m[?7h[?1h=[H[J[22B[J[H[K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [K [0;7mGetting http://billing/pipe/pop.php%1B%5Bm%0F [22;53H [J[1A[0;7mLooking up billing[m [22;36H [J[1A[0;7mMaking HTTP connection to billing[m [J[1A[0;7mSending HTTP request.[m [22;22H [J[1A[0;7mHTTP request sent; waiting for response.[m [J [24;1H [?1l>
So, the question is, how do I set the terminal type for a cronjob?
On Tue, Sep 30, 2008, Rudi Ahlers wrote:
Hi,
I'm running a crontjob on CentOS 5.2 server, which then connects to a webpage to run some stuff. It has to run this way, since the webpage is on a Windows server, and the Windows scheduled tasks doesn't work as well.
It seems like the cronjob is working fine, except that the email output worries me a bit.
This is what I get on email,
...
So, the question is, how do I set the terminal type for a cronjob?
There are many ways to do this depending on the type of program executed by the cron job (e.g. shell script, perl, python, or compiled program). One way that will always work is to write a wrapper script that execs the real script, something like:
#!/bin/sh # set a terminal type that makes your application happy TERM=dumb export TERM # set any other environment variables as necessary exec /path/to/real/script
Bill
Rudi Ahlers wrote on Tue, 30 Sep 2008 17:44:02 +0200:
It has to run this way, since the webpage is on a Windows server, and the Windows scheduled tasks doesn't work as well.
I'd rather look there why it doesn't work for you. Scheduled tasks works just fine on my Windows servers. I'm not getting an email from them, if that is what you want, though. Btw, you can also install cron on Windows!
Kai
On Tue, Sep 30, 2008 at 6:31 PM, Kai Schaetzl maillists@conactive.com wrote:
Rudi Ahlers wrote on Tue, 30 Sep 2008 17:44:02 +0200:
It has to run this way, since the webpage is on a Windows server, and the Windows scheduled tasks doesn't work as well.
I'd rather look there why it doesn't work for you. Scheduled tasks works just fine on my Windows servers. I'm not getting an email from them, if that is what you want, though. Btw, you can also install cron on Windows!
Kai
-- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
Hi Kai,
Even though it would be ideal for it to run on the Windows server, the scheduled tasks simple doesn't work reliably. The script that needs to be triggered is WHMCS's (http://www.whmcs.com)%27s billing & support crons. The support cron needs to run every 5 minutes, and the billing one every hour.
When I set it up on the Windows server, it will work fine for a week or even 3, and then stops working without any warnings. According to Windows, it is running, but I never actually get the billing to work. Our clients was supposed to be invoiced on the 25th, and they didn't get their invoices, and it's now the 30th already.
So, I decided to use something that I know, cron.
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe
On Wed, Oct 1, 2008 at 12:37 AM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe _______________________________________________
Hi, yes sorry I should have added that :)
I'm using lynx, as follows:
9 0 * * * /usr/bin/lynx http://billing/admin/cron.php */5 * * * * /usr/bin/lynx http://billing/pipe/pop.php
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 12:37 AM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe _______________________________________________
Hi, yes sorry I should have added that :)
I'm using lynx, as follows:
9 0 * * * /usr/bin/lynx http://billing/admin/cron.php */5 * * * * /usr/bin/lynx http://billing/pipe/pop.php
Lynx wants to do cursor positioning which is fairly useless in non-interactive mode. You can give it a terminal type on the command line with the -term= option, but it would probably be better to use wget instead for non-interactive work.
On Wed, Oct 1, 2008 at 7:06 AM, Les Mikesell lesmikesell@gmail.com wrote:
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 12:37 AM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe _______________________________________________
Hi, yes sorry I should have added that :)
I'm using lynx, as follows:
9 0 * * * /usr/bin/lynx http://billing/admin/cron.php */5 * * * * /usr/bin/lynx http://billing/pipe/pop.php
Lynx wants to do cursor positioning which is fairly useless in non-interactive mode. You can give it a terminal type on the command line with the -term= option, but it would probably be better to use wget instead for non-interactive work.
-- Les Mikesell lesmikesell@gmail.com _______________________________________________
wget downloads the whole page every time, which wastes bandwidth & HDD space. Apart from using the "> /dev/null" option, is there any other way to use it?
And with lynx, do I just issue lynx -term=vt100 http://billing/admin/cron.php ?
On Wed, Oct 1, 2008 at 1:29 PM, Rudi Ahlers rudiahlers@gmail.com wrote:
wget downloads the whole page every time, which wastes bandwidth & HDD space. Apart from using the "> /dev/null" option, is there any other way to use it?
wget -O- and then devnull :-)
curl --silent is quite nice as well
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 7:06 AM, Les Mikesell lesmikesell@gmail.com wrote:
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 12:37 AM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe _______________________________________________
Hi, yes sorry I should have added that :)
I'm using lynx, as follows:
9 0 * * * /usr/bin/lynx http://billing/admin/cron.php */5 * * * * /usr/bin/lynx http://billing/pipe/pop.php
Lynx wants to do cursor positioning which is fairly useless in non-interactive mode. You can give it a terminal type on the command line with the -term= option, but it would probably be better to use wget instead for non-interactive work.
wget downloads the whole page every time, which wastes bandwidth & HDD space. Apart from using the "> /dev/null" option, is there any other way to use it?
Lynx is going to send the page to stdout, which cron will collect and email to you unless you have redirected to /dev/null also, so I don't see a big difference there. For static pages wget can use -N to only get copies after they change, and the -O option to control where it goes, which could be /dev/null if you really never want to see it.
And with lynx, do I just issue lynx -term=vt100 http://billing/admin/cron.php ?
Yes, but I'd recommend doing 'man lynx', 'man wget', and 'man curl' so you understand the options and features of each.
On Wed, Oct 1, 2008 at 2:55 PM, Les Mikesell lesmikesell@gmail.com wrote:
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 7:06 AM, Les Mikesell lesmikesell@gmail.com wrote:
Rudi Ahlers wrote:
On Wed, Oct 1, 2008 at 12:37 AM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi,
On Tue, Sep 30, 2008 at 16:30, Rudi Ahlers rudiahlers@gmail.com wrote:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
How are you calling these scripts from cron? lynx? wget? curl? Maybe the problem is with the tool you are using to do that. If you give us more details, we might be able to help you better.
HTH, Filipe _______________________________________________
Hi, yes sorry I should have added that :)
I'm using lynx, as follows:
9 0 * * * /usr/bin/lynx http://billing/admin/cron.php */5 * * * * /usr/bin/lynx http://billing/pipe/pop.php
Lynx wants to do cursor positioning which is fairly useless in non-interactive mode. You can give it a terminal type on the command line with the -term= option, but it would probably be better to use wget instead for non-interactive work.
wget downloads the whole page every time, which wastes bandwidth & HDD space. Apart from using the "> /dev/null" option, is there any other way to use it?
Lynx is going to send the page to stdout, which cron will collect and email to you unless you have redirected to /dev/null also, so I don't see a big difference there. For static pages wget can use -N to only get copies after they change, and the -O option to control where it goes, which could be /dev/null if you really never want to see it.
And with lynx, do I just issue lynx -term=vt100 http://billing/admin/cron.php ?
Yes, but I'd recommend doing 'man lynx', 'man wget', and 'man curl' so you understand the options and features of each.
-- Les Mikesell lesmikesell@gmail.com
I got lynx to work with the --dump option, and now the errors are gone, and the cronjob works well. wget downloaded the whole website which was like 23MB everytime, whereas lynx gave me the output, which is more usable for trouble shooting the cronjob.
Thanx for all your help
Rudi Ahlers wrote:
I got lynx to work with the --dump option, and now the errors are gone, and the cronjob works well. wget downloaded the whole website which was like 23MB everytime, whereas lynx gave me the output, which is more usable for trouble shooting the cronjob.
wget should only download 'the whole website' if you specify a -r (recursive) option, otherwise it would just fetch the one file you specified.
Rudi Ahlers wrote on Wed, 1 Oct 2008 15:37:54 +0200:
wget downloaded the whole website which was like 23MB everytime,
then you added parameters you shouldn't have added. A simple wget URL downloads only that document and nothing else.
Kai
Hi all,
I'm looking to test out a solution with CentOS instead of our venerable RHEL3-servers. Some of the software we use and need, requires for it to run on RHEL. Figuring that CentOS is binary compatible with RHEL this should work anyway. I also found out using Google that many programs look in /etc/redhat-release file to check that the right OS is there.
After checking the contents on a CentOS machine I have available, as well as one running RHEL3 and 4, my guess would be that adding the "correct" text in the redhat-release file on CentOS would enable picky software requiring RHEL to run in CentOS instead.
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
Ideas and comments are welcome! TIA.
Yes. it will work on some softwares. I have been use this way several times and successfully "cheating" ORACLE DB installation and DELL OPMN installation.
But it failed to "cheating" on "Veritas Netbackup" installation.
--- 08/10/1 (星期三),Sorin@Gmail sorin.srbu@gmail.com 寫道: 寄件者: Sorin@Gmail sorin.srbu@gmail.com 主旨: [CentOS] Faking RHEL with CentOS 收件者: "'CentOS mailing list'" centos@centos.org 日期: 2008 10 1 星期三 上午 9:53
Hi all,
I'm looking to test out a solution with CentOS instead of our venerable RHEL3-servers. Some of the software we use and need, requires for it to run on RHEL. Figuring that CentOS is binary compatible with RHEL this should work anyway. I also found out using Google that many programs look in /etc/redhat-release file to check that the right OS is there.
After checking the contents on a CentOS machine I have available, as well as one running RHEL3 and 4, my guess would be that adding the "correct" text in the redhat-release file on CentOS would enable picky software requiring RHEL to run in CentOS instead.
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
Ideas and comments are welcome! TIA.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of mcclnx mcc Sent: Wednesday, October 01, 2008 4:47 PM To: CentOS mailing list Subject: RE: [CentOS] Faking RHEL with CentOS
Yes. it will work on some softwares. I have been use this way several times and successfully "cheating" ORACLE DB installation and DELL OPMN installation.
But it failed to "cheating" on "Veritas Netbackup" installation.
So it works with some software, but not generally. Ok, thx.
on 10-1-2008 6:53 AM Sorin@Gmail spake the following:
Hi all,
I'm looking to test out a solution with CentOS instead of our venerable RHEL3-servers. Some of the software we use and need, requires for it to run on RHEL. Figuring that CentOS is binary compatible with RHEL this should work anyway. I also found out using Google that many programs look in /etc/redhat-release file to check that the right OS is there.
After checking the contents on a CentOS machine I have available, as well as one running RHEL3 and 4, my guess would be that adding the "correct" text in the redhat-release file on CentOS would enable picky software requiring RHEL to run in CentOS instead.
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
Ideas and comments are welcome! TIA.
No amount of faking will make software for RHEL3 or 4 install on CentOS 5. You can only do it on equal releases IE... RHEL 3 to CentOS 3 etc.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Wednesday, October 01, 2008 5:35 PM To: centos@centos.org Subject: [CentOS] Re: Faking RHEL with CentOS
No amount of faking will make software for RHEL3 or 4 install on CentOS 5. You can only do it on equal releases IE... RHEL 3 to CentOS 3 etc.
Of course. It's implied. Should've mentioned it though. 8-)
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
JohnStanley Writes:
Yes that will work. Replace the appropriate string. Also do cat /etc/issue. One more and it is called programatically "rpm --whatprovides"
JohnStanley
On Wed, Oct 1, 2008 at 11:06 AM, John jses27@gmail.com wrote:
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
JohnStanley Writes:
Yes that will work. Replace the appropriate string. Also do cat /etc/issue. One more and it is called programatically "rpm --whatprovides"
If there are 10000 files it might look at 10000 different places including device names.... kernel names, shell features, kernel modules and more. i.e all the things that 'configure' might know about and more.
/etc/redhat-release is the most common. N.B. You may need to restore the CentOS words often to permit CentOS updates to do the right thing.
If /etc/redhat-release is not the answer you may have to look harder at the failing process with strace or even SELinux tricks to see what it does look at.
If it is Oracle, Given the price of Oracle -- just purchase the RH product. It is common that the expensive packages are the most restrictive and putative.
NiftyClusters T Mitchell wrote:
If there are 10000 files it might look at 10000 different places including device names.... kernel names, shell features, kernel modules and more. i.e all the things that 'configure' might know about and more.
Yeah, that's my main worry.
/etc/redhat-release is the most common. N.B. You may need to restore the CentOS words often to permit CentOS updates to do the right thing.
I've been thinking about that too, ever since I did a yum update yesterday on my test machine. I had the centos-line commented out and instead had a rhel-line in there. AFAICT, the update went through fine, incl a kernel update. But this might be a potential gotcha'.
If /etc/redhat-release is not the answer you may have to look harder at the failing process with strace or even SELinux tricks to see what it does look at.
Use SELinux tricks even if I don't have it installed? I'm not that familiar with SELinux, except for knowing it's a security hardened something or other.
If it is Oracle, Given the price of Oracle -- just purchase the RH product. It is common that the expensive packages are the most restrictive and putative.
Nah, not Oracle. We run Orcacle on Windows here. It's a constant pain for our db-admin. Main concern are a handful of proprietary molecular building and calculation suites. The *nix-group here uses computer aided drug design. There are db's involved but they are installed and run from each software suite, w/o involvement of Oracle or some such.
John wrote:
From CentOS /etc/redhat-release:
CentOS release 5.2 (Final)
From RHEL3 /etc/redhat-release:
Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
From RHEL4 /etc/redhat-release:
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Has anybody maybe actually done this already and can tell if it'd work?
What other places may a software look into to check the computer runs the correct OS?
JohnStanley Writes:
Yes that will work. Replace the appropriate string. Also do cat /etc/issue. One more and it is called programatically "rpm --whatprovides"
Nice! Thx, will investigate the suggested files and rpm stuff.
Rudi Ahlers wrote on Tue, 30 Sep 2008 22:30:29 +0200:
I simply need to call 2 php scripts via a website - very simple todo, but cron tends to give me these errors for some odd reason, and the scripts doesn't run on the remote website.
People usually use wget for triggering such tasks, have you tried that? Does you script run fine when not run from cron?
Kai