Operating System - HP-UX
1748054 Members
4728 Online
108758 Solutions
New Discussion юеВ

Re: tar /dev/tty request when run with at

 
SOLVED
Go to solution
Vladimir Tihu
Advisor

tar /dev/tty request when run with at


Using tar interactively I can create archives >2Gb, but when I put it in a script run with at the archive stops at 2Gb with a message to tar's standard output: "Can't open /dev/tty to prompt for more media.".
Is there a way to prevent tar from (pseudo)requesting media from terminal? (when run interactively it doesn't really prompt it simply runs on).

Thanks

Vladimir

4 REPLIES 4
David_246
Trusted Contributor

Re: tar /dev/tty request when run with at

Hi Vladimir,

This is a know issue when interaction is needed.

Please do the following :

tar cvf .. ...

Best Regs David
@yourservice
Jean-Louis Phelix
Honored Contributor

Re: tar /dev/tty request when run with at

Hi,

No, you can't do it because I suppose that your script is run from crontab or something similar which is not attached to any tty

Regards
It works for me (┬й Bill McNAMARA ...)
Frank Slootweg
Honored Contributor
Solution

Re: tar /dev/tty request when run with at

This is probably due to the ulimit setting for an at(1) job.

Do
echo ulimit | at now + 1 minute
to see the setting.

You can hopefully change the setting in your script. If not, you will have to change /var/adm/cron/.proto accordingly. See the at(1) and proto(4) manual pages for details.

Note that ulimit details depend on the type of shell. See the "#! ..." line, if any, at the beginning of your script.

Depending on your OS version and patch-level, you may also run into an old at(1)/.proto bug.
Vladimir Tihu
Advisor

Re: tar /dev/tty request when run with at


Yes, the ulimit was the problem; in the interactive environment it was set to unlimited but at has a different default setting.
(redirecting standard input to anything doesn't work, tar wants the terminal, anyway).

Problem solved.

Thanks.