HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Expect script cronjob tty problem
Operating System - HP-UX
1834058
Members
2628
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 08:29 AM
05-28-2003 08:29 AM
Expect script cronjob tty problem
I am running an expect script from a cronjob. The script runs fine when run manually from a console but when run from cron, I get strange errors tty errors and the scrips fails.
The cronjob calls the expect script as follows:
su - is2prod -c /usr/local/bin/expect /home/is2prod/isbackup.exp
Here is what is happening when the expect script trys to run:
# tail -f isprod.log
ttytype: couldn't open /dev/tty for reading
stty: : Not a typewriter
(c)Copyright 1983-1997 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-1997 Mentat, Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1997 Isogon Corporation
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
logout Any ideas would be appreciated.
Thanks,
Craig
The cronjob calls the expect script as follows:
su - is2prod -c /usr/local/bin/expect /home/is2prod/isbackup.exp
Here is what is happening when the expect script trys to run:
# tail -f isprod.log
ttytype: couldn't open /dev/tty for reading
stty: : Not a typewriter
(c)Copyright 1983-1997 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-1997 Mentat, Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1997 Isogon Corporation
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
logout Any ideas would be appreciated.
Thanks,
Craig
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 08:53 AM
05-28-2003 08:53 AM
Re: Expect script cronjob tty problem
Hi Craig,
Running su - is2prod will read the user's .profile - which probably contains stty settings and other things that require a tty. The way round it is to use su is2prod without the "-"; then ensure that any relevant parts of .profile are included in a script which is called before you run expect.
regards,
Darren.
PS: Please remember to assign points to people who have helped you - it rewards those that have spent time on solutions, and helps others determine useful answers.
Running su - is2prod will read the user's .profile - which probably contains stty settings and other things that require a tty. The way round it is to use su is2prod without the "-"; then ensure that any relevant parts of .profile are included in a script which is called before you run expect.
regards,
Darren.
PS: Please remember to assign points to people who have helped you - it rewards those that have spent time on solutions, and helps others determine useful answers.
Calm down. It's only ones and zeros...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 09:44 AM
05-28-2003 09:44 AM
Re: Expect script cronjob tty problem
Expect spawns it own shell with:
spawn $env(SHELL)
If I set the env variables in the script prior to calling the expect script, would the above command spawn a new shell without the variables or would they remain set.
spawn $env(SHELL)
If I set the env variables in the script prior to calling the expect script, would the above command spawn a new shell without the variables or would they remain set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 09:56 AM
05-28-2003 09:56 AM
Re: Expect script cronjob tty problem
I believe if you export them, they will be passed through the shell.
ie export MYDATABASE=/data1/blah
regards,
Darren.
ie export MYDATABASE=/data1/blah
regards,
Darren.
Calm down. It's only ones and zeros...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP