Cannot get this bash/expect script to run under a crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cannot get this bash/expect script to run under a crontab
# 8  
Old 06-27-2012
put this statement in the crontab

Code:
*/5 * * * * /ftp/office_in_a_box/rap.sh 2>/tmp/rap.err 1>/tmp/rap.out
 
got this result

[bluecoat_ftp@bb-va01-sv55-nm office_in_a_box]$ cat /tmp/rap.err 
stty: impossible in this context
are you disconnected or in a batch, at, or cron script?stty: ioctl(user): bad file number
    while executing
"stty echo "
stty: impossible in this context
are you disconnected or in a batch, at, or cron script?stty: ioctl(user): bad file number
    while executing
"stty echo "
stty: impossible in this context
are you disconnected or in a batch, at, or cron script?stty: ioctl(user): bad file number
    while executing
"stty echo "
stty: impossible in this context
are you disconnected or in a batch, at, or cron script?stty: ioctl(user): bad file number
    while executing
"stty echo "


Last edited by methyl; 06-27-2012 at 08:24 PM.. Reason: code tags
This User Gave Thanks to mrkool For This Post:
# 9  
Old 06-27-2012
Thank you for responding. We all learn more when things do not go to plan.

Wow. That's the most obscure version of "not a terminal" I have ever seen .... unless someone has seen a better one.


Anybody Googling that error message will find this thread. That is good.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script acting funny when run from Crontab

Hello, first time here. I have a script that seems to ignore the if statement when run from the cron. I am using Ubuntu 12.10 #!/bin/bash DOWN=/usr/sbin/dcon UP="pon dsl-provider" LOG=/var/log/dsl-reconnect.log RECV=`ifconfig 2>&1|grep ppp0|cut -d , -f 5|cut -d " " -f 1` if ] then... (1 Reply)
Discussion started by: mkoster
1 Replies

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. Shell Programming and Scripting

Expect script not working in crontab with minicom

Hi All, I am testing expect script in command prompt without issue, but in crontab it is not working, i check the output error as below: #cat /var/log/testexp.log spawn minicom -C /var/log/minicom1.log No cursor motion capability (cm) AT+COPS=? I am new in scripting, together... (1 Reply)
Discussion started by: elingtey
1 Replies

4. UNIX for Advanced & Expert Users

Unable to run the script on remote machine Using Expect script

Not able to execute the file in remote host using except utility I am automating the SFTP keys setp process: So i created the expect script for controlling the output of shell below is my main code: Code: #!/usr/bin/expect set fd set password close $fd set df set app close $df... (1 Reply)
Discussion started by: Manoj Bajpai
1 Replies

5. Shell Programming and Scripting

Use expect to run an interactive shell script?

Hi all, I have a bit of a vexing issue here and I'm not certain how best to go about it. Basically, I want to run a shell script and automate the user prompt of hitting 1 to fully uninstall Symantec Anti-Virus for OS X. Would expect be the best way to do this? (5 Replies)
Discussion started by: prometheon123
5 Replies

6. Shell Programming and Scripting

Expect Script Not working with Crontab

I have the following expect script sitting on a Linux box. === #!/usr/bin/expect -f # # backup.expect # # Expect script to backup a firewall via a SSH session # # set firewall set username set password set prompt set filename match_max 50000 spawn ssh -l... (2 Replies)
Discussion started by: alagondar
2 Replies

7. Programming

Expect script to run a Shell script on remote server

Hi All, I am using a expect script to run a shell script on remote server, the code is as follows. But the problem is that it executes only first command, and hangs it doesn't run the next commands. spawn ssh $uid@$host expect "password:" send "$password\r" expect "*\r" send... (2 Replies)
Discussion started by: yashwanthsn
2 Replies

8. Shell Programming and Scripting

Expect script on crontab

Hi All, I have an expect script called sftp to transfer using SFTP below : # more sftp #!/usr/local/bin/expect # Initialisation set authFile "/home/ap1030/transfer/.password" # Check the authorisation file exists if {!} { ;# Does file exist send_user "$authFile does not exist;... (6 Replies)
Discussion started by: ap1030
6 Replies

9. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

10. Shell Programming and Scripting

Expect script doesn't work under crontab

Hi All, Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea? This is what I have under root crontab... 00 18 * * 1-5... (4 Replies)
Discussion started by: samnyc
4 Replies
Login or Register to Ask a Question