LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cron tab error: No entry for terminal type "unknown"; sing dumb terminal settings. (https://www.linuxquestions.org/questions/linux-software-2/cron-tab-error-no-entry-for-terminal-type-unknown-%3B-sing-dumb-terminal-settings-773146/)

shlomi.s 12-03-2009 03:59 AM

Cron tab error: No entry for terminal type "unknown"; sing dumb terminal settings.
 
hi everybody.

first of all, i want you to know that i tried to Google my problem couple of hours but i didn't found any GOOD answer, can you please try to explain me what is the problem?

here it is:

i running this cron-tab:
"
cd /MY_PATH/www/; sudo php -f cron.MY_CROM.php
"

MY_PATH and MY_CRON are fake names - off course.. :-)

please note that the user that run this cron is sudoer.

here is the configurations for this user in 'visudo' file:
"
my_user ALL=(ALL) NOPASSWD: NOPASSWD: ALL
"

this cron is run about a month and everything was fine till couple of days, then it's started to prompt me this notice:
"
No entry for terminal type "unknown";
using dumb terminal settings.
"

did someone can explain me what i the problem?


thanks in advance.

Shlomi.

repo 12-03-2009 04:14 AM

Welcome to LQ

Which distribution are you using ?
Seems to me xterm is missing.

shlomi.s 12-03-2009 04:37 AM

i'm using Fedora 11

shlomi.s 12-03-2009 04:38 AM

i did 'yum install xterm' it's found and install it.. let's see what will happened..

shlomi.s 12-03-2009 05:21 AM

hi

even i installed the xterm i stil getting the message:
"
No entry for terminal type "unknown";
using dumb terminal settings.
"

any other idea?

knudfl 12-03-2009 10:44 AM

Cron : use full path.
Cron does not understand anything but a full path for a command.

sudo /usr/bin/php -f <full-path-to>/cron.MY_CROM.php

.. will probably work.

.....

chrism01 12-03-2009 06:48 PM

<full-path-to-sudo>/sudo as well

catkin 12-04-2009 01:11 AM

Jobs run from cron do not have a terminal. Does the message imply that the /usr/bin/php -f <full-path-to>/cron.MY_CROM.php command is trying to use a terminal -- in which case it cannot work?

If my musing is on the right lines, how come "this cron is run about a month and everything was fine till couple of days". Perhaps cron.MY_CROM.php has been changed, introducing the need for a terminal or, less likely, /usr/bin/php.

Valery Reznic 12-04-2009 01:24 AM

Quote:

Originally Posted by knudfl (Post 3778562)
Cron : use full path.
Cron does not understand anything but a full path for a command.

sudo /usr/bin/php -f <full-path-to>/cron.MY_CROM.php

.. will probably work.

.....

In my experience cron has PATH=/bin:/usr/bin, so full path for the commands shouldn't be a problem.
In any case it's looks like error message came from the php script, i.e
cron was able to run it.

But TREM environment variable in cron likely tobe empty (or 'unknown')
and I think it's a reason why php script complains.

Also I wonder, why script designed to run without user interaction
care what terminal it run in ?

shlomi.s 12-05-2009 02:35 PM

still error.. please help...
 
Quote:

Originally Posted by Valery Reznic (Post 3779313)
In my experience cron has PATH=/bin:/usr/bin, so full path for the commands shouldn't be a problem.
In any case it's looks like error message came from the php script, i.e
cron was able to run it.

But TREM environment variable in cron likely tobe empty (or 'unknown')
and I think it's a reason why php script complains.

Also I wonder, why script designed to run without user interaction
care what terminal it run in ?


hi Helpers.. thanks for your concern..


i tried to change the cron to full path as Catkin suggestion but still pormpting the message. the new cron is:
" sudo /usr/bin/php -f /home/MY_PATH/cron.MY_CRON.php "

but i have coule of questions for 'chrism01' and for 'Valery Reznic'

my question for 'chrism01' is, what did you meant in:
Quote:

<full-path-to-sudo>/sudo as well
?
what is the path for sudo command? just to remind you i'm using fedora 11 distribution.


and my question for 'Valery Reznic' is, in in your quote:
Quote:

But TREM environment variable in cron likely tobe empty (or 'unknown')
and I think it's a reason why php script complains.
i didn;t understood what is reason? what is TERM at all??

second, about:
Quote:

Also I wonder, why script designed to run without user interaction
care what terminal it run in ?
i did it via PHP script because it's most easy for me ( as a PHP programmer), this script shall delete all files is some directory each hour but not the files that added in the last 10 minutes.. i don't very familiar with Linux Bash scripts so i did it via PHP, is this problematic?

thanks again to all of you..

Valery Reznic 12-06-2009 05:35 AM

Quote:

Originally Posted by shlomi.s (Post 3781124)
hi Helpers.. thanks for your concern..


i tried to change the cron to full path as Catkin suggestion but still pormpting the message. the new cron is:
" sudo /usr/bin/php -f /home/MY_PATH/cron.MY_CRON.php "

but i have coule of questions for 'chrism01' and for 'Valery Reznic'

my question for 'chrism01' is, what did you meant in:
?
what is the path for sudo command? just to remind you i'm using fedora 11 distribution.


and my question for 'Valery Reznic' is, in in your quote:

i didn;t understood what is reason? what is TERM at all??

second, about:

i did it via PHP script because it's most easy for me ( as a PHP programmer), this script shall delete all files is some directory each hour but not the files that added in the last 10 minutes.. i don't very familiar with Linux Bash scripts so i did it via PHP, is this problematic?

thanks again to all of you..

php itself is OK, as any other scripting language.

Term is environment variable it's content is terminal type. Any program (or library - for example ncurces) can examine this variable to determine what terminal is used.

Usually only interactive program need it.

You can try to run
Code:

TERM= /usr/bin/php -f <full-path-to>/cron.MY_CROM.php
From the command line.
It should give you same error messages about terminal

and you can try change your line for cron as
Code:

sudo /usr/bin/env TERM=xterm /usr/bin/php -f /home/MY_PATH/cron.MY_CRON.php
And see if it's help.
But all the same. I don't understand, why your program interested in the TERM

shlomi.s 12-07-2009 10:24 AM

Thanks.. It's working..
 
Quote:

Originally Posted by Valery Reznic (Post 3781564)
php itself is OK, as any other scripting language.

Term is environment variable it's content is terminal type. Any program (or library - for example ncurces) can examine this variable to determine what terminal is used.

Usually only interactive program need it.

You can try to run
Code:

TERM= /usr/bin/php -f <full-path-to>/cron.MY_CROM.php
From the command line.
It should give you same error messages about terminal

and you can try change your line for cron as
Code:

sudo /usr/bin/env TERM=xterm /usr/bin/php -f /home/MY_PATH/cron.MY_CRON.php
And see if it's help.
But all the same. I don't understand, why your program interested in the TERM

Looks like this fixing helped:
Quote:

sudo /usr/bin/env TERM=xterm /usr/bin/php -f /home/MY_PATH/cron.MY_CRON.php
now i stopped getting the message..

thanks for everybody..

k1mgy 09-06-2011 09:20 AM

If fedora-based:

edit: /root/.bash_profile
add: term=xterm


All times are GMT -5. The time now is 12:26 AM.