1828040 Members
2054 Online
109973 Solutions
New Discussion

Re: run batch error

 
heaman1
Regular Advisor

run batch error

I have added a script ( run at cron ) to scp file to remote server , it is fine to copy the file to remote server , but it pop the message "No value for $TERM and no -T specified" , ( even have the message , but still works fine ) , can advise how to erase the message when everytime run this batch job ? thx
14 REPLIES 14

Re: run batch error

this is the IT equivalent of going to a mechanic and having the following conversation:

- my car makes a funny rattling sound when I drive it...
* OK can I take a look at it?
- No I didn't bring it with me
* ah well - not sure I can help you then

You get the point? You have a script that does something (which apparently involves a scp, but who knows what else) - you get an error message from it, and you want help fixing it, but you haven't shared the script

who knows *where* that error message comes from - could be anywthing - if I were to guess, I'd say there's some code in there that's assuming you are attached to a terminal, such as some login .profile sourcing which might come from soing a "su - user" somewhere in the script - but as you didn't share any details, its not easy to help any further...

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Basheer_2
Trusted Contributor

Re: run batch error

Heaman.

You have to the right group and please post you script, so you get results very fast.

Thanks
heaman1
Regular Advisor

Re: run batch error

thx replies and sorry to fail to paste my command when post the question , the below is the command I used.


scp edp_usr@192.168.0.2:/tmp




Thx

Re: run batch error

and that's the whole script is it?

somehow I doubt it, as that appears to be half of a scp statement... posting fragments isn't going to work... please post the cron entry and the full script

HTH

Duncan

I am an HPE Employee
Accept or Kudo
heaman1
Regular Advisor

Re: run batch error

scp /tmp/test.ora edp_usr@192.168.0.2:/tmp

while I set ssh without password
Suraj K Sankari
Honored Contributor

Re: run batch error

Hi,

Can you upload your script ?

Suraj

Re: run batch error

scp /tmp/test.ora edp_usr@192.168.0.2:/tmp

and that's what appears in cron is it?

I can see _no_ way that this would cause the message you are seeing, which makes me think there's more to your script than just this one line.

If you are not prepared to help yourself by providing the right information, you're unlikely to get a satisfactory outcome...

HTH

Duncan

I am an HPE Employee
Accept or Kudo
heaman1
Regular Advisor

Re: run batch error

thx reply

the is really the script that I run at cron , but the message is happens in RH linux server ,

if the message is caused from the incorrect TERM setting , can I add the TERM setting to the batch job ? thx

Re: run batch error

ahh and we were just supposed to guess that were we?

So the googling on error message in question seems to indicate that it comes from the "tput" command, which again suggests that this comes from a login operation somewhere (like an entry bin a .profile or .bashrc or similar)

But as we are still flailing around trying to understand you end-to-end process, it's hard to say...

- you have a cron job that is a simple scp command... does that cron run on HP-UX or RedHat?

- *where* do you see the "No value for $TERM and no -T specified" message? at what point during the operation and in a log, or seomwhere else

Is HP-UX involved in this at all? If not you've posted in the wrong forum...


HTH

Duncan

I am an HPE Employee
Accept or Kudo
Ganesan R
Honored Contributor

Re: run batch error

Hi,

If you don't need the standard output and standard error message produced by the script just redirect the outputs to /dev/null like this in cron

0 2 * * * <script with full path> >/dev/null 2>&1


Hope this will fix..
Best wishes,

Ganesh.
heaman1
Regular Advisor

Re: run batch error

thx reply ,

- you have a cron job that is a simple scp command... does that cron run on HP-UX or RedHat? --> Redhat

- *where* do you see the "No value for $TERM and no -T specified" message? at what point during the operation and in a log, or seomwhere else --> I got mail that have this error ,

Is HP-UX involved in this at all? If not you've posted in the wrong forum...

--> the command run on HP-UX works without any problem , but have the problem in RH .

thx
macosta
Trusted Contributor

Re: run batch error

heaman1,
I don't think this is coming from the scp command. You mention using ssh as well. It is possible that ssh is throwing this error because it's running from a batch job with no controlling terminal. It tells you exactly what is wrong - either set up a valid $TERM or utilize the "-T" option, which the man page says "Disable[s] pseudo-tty allocation".

As stated, it would be easier if you could post the script.
Suraj K Sankari
Honored Contributor

Re: run batch error

Hi,

Thats true first you post your script then it will be easy to catch your error.

Suraj
Jean-Yves Picard
Trusted Contributor

Re: run batch error

hello

try to add
-o BatchMode=yes to scp command.
e.g.

scp -o batchmode=yes /local/file remote:/file

Jean-Yves