Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

tar /dev/tty request when run with at

Go to solution

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).



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
Jean-Louis Phelix
Honored Contributor

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


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

It works for me (© Bill McNAMARA ...)
Frank Slootweg
Honored Contributor

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

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

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.

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.