- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- date command gives rubbish o/p
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО04-03-2008 12:38 AM
тАО04-03-2008 12:38 AM
crontab fails and gives the the following error;
-tty type could not open /dev/tty for reading
-stty not a typewriter.
The crontab excutes a tar opration on a dumb file to which date command o/p is added to its name (e.g dumb030408)for today dumb file.
I excuted the date command as root on a CDE session and it generated a rubbish o/p,
but when date is excuted as other user(oracle)it was o.k
I checked $TERM ,its vt100
I checked root's .profile,it looked ok ,anyway I do not expect anyone to have tampered with it.
Note;if root excutes date command on console it gives meaningfull o/p:
Thu Apr 3 10:32:00 WAT 2008
Please help
Solved! Go to Solution.
- Tags:
- stty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 01:09 AM - edited тАО02-08-2014 07:54 PM
тАО04-03-2008 01:09 AM - edited тАО02-08-2014 07:54 PM
Re: date command gives rubbish output
I don't see any date commands. I see an example of an illegal .profile, not set up to play in the majors.
You'll need to condition anything in your .profile to not execute tty type commands if you are not on a tty:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1198910
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1162063
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1155025
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1146959
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 02:01 AM
тАО04-03-2008 02:01 AM
Re: date command gives rubbish o/p
>>
I don't see any date commands. I see an example of an illegal .profile, not set up to play in the majors.
<<
I seriously doubt anyone outside the US would understand this terminology.
What it means is your profile or .profile environment is wrong.
Possible fixes:
Copy a .profile from a working machine.
env >machine1.txt
env >machine2.txt
put them on the same machine and then use diff to compare.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 02:08 AM
тАО04-03-2008 02:08 AM
Re: date command gives rubbish o/p
>stty sane
command if ur .profile is not very bad ;)
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 02:49 AM
тАО04-03-2008 02:49 AM
Re: date command gives rubbish o/p
eval `ttytype -s`
tset
by
http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1218881
may help,
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 04:14 AM - edited тАО02-08-2014 07:55 PM
тАО04-03-2008 04:14 AM - edited тАО02-08-2014 07:55 PM
Re: date command gives rubbish output
>SEP: I seriously doubt anyone outside the US would understand this terminology.
(Not ready for prime time? :-)
Actually not usable in cron/at jobs.
>Copy a .profile from a working machine.
This is not likely to work since the HP supplied .profile is broken as Bill says in some of the provided links.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 04:59 PM
тАО04-03-2008 04:59 PM
Solution> -tty type could not open /dev/tty for reading
> -stty not a typewriter.
This is caused by the job running /etc/profile and .profile from an su command. The profiles must have all the terminal-specific commands like ttytype and tabs protected because there is no terminal in cron. But these errors should not have caused the script to stop, so you need to add: set -u at the start of the script and run it from cron. You'll now get a trace of the script. The errors will be more obvious.
> I executed the date command as root on a CDE session and it generated a rubbish o/p,
and the rubbish output is???
Be aware that running scripts from a login shell with a keyboard is very different from running as a cron job.
> I checked $TERM ,its vt100
Meaningless in cron which is why the profiles should be rewritten to protect the terminal-only commands.
You showed that the output from date was appended to the filename: dumb030408 but said the date command looks like this:
Thu Apr 3 10:32:00 WAT 2008
So the script to perform the tar command does not use a plain date command but one with a formatting string such as:
date "+%m%d%C"
Bill Hassell, sysadmin