System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

tar failed only when using cron

hot948
Occasional Contributor

tar failed only when using cron

Hp-UX 11.23

 

always tar met this error

"Can't open /dev/tty to prompt for more media."

 

I know This error tar archive files greater than 2GB in size and this problem happened only using cron.

so I modify .prot file. but still errors.

 

#crontab -l

17 16 * * *  /usr/bin/sh -c "./var/adm/cron/.proto" ; /home/vpjs/monbackup.sh 2>&1 >>  /home/vpjs/monbackup.log.cron
#

#cat /var/adm/cron/.proto

# @(#)B.11.23_LR
cd $d
echo starting .proto l is $l
if [ $l -ge 4194303 ]
then
   echo setting to unlimited
   ulimit unlimited
else
   echo setting to $l
   ulimit $l
fi
umask $m

$<
echo ending .proto

#

 

#cat cronoutlog

.

.

a /home/shyang/kb20100228/crash.0/aaa 1310640 blocks
a /home/shyang/kb20100228/crash.0/bbb 4973195 blocks
a /home/shyang/kb20100228/crash.0/ccc 3931920 blocks
a /home/shyang/kb20100228/crash.0/eee 1310640 blocks
a /home/shyang/kb20100228/crash.0/fff 1310640 blocks
a /home/shyang/kb20100228/crash.0/ttt 7863840 blocks
Can't open /dev/tty to prompt for more media.

 

Pls check what am I wrong.

 

Regards

2 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: tar failed only when using cron

Hi:

 

THe error "Can't open /dev/tty to prompt for more media" tells you that 'tar' want a second output tape, but first wants to ask you if that's OK.  Since a 'cron' process isn't associated with a terminal, the 'tar' terminates at that point.

 

Regards!

 

...JRF...

Dennis Handly
Acclaimed Contributor

Re: tar failed only when using cron

>so I modify .prot file but still errors.

 

Modify it how?  You better undo your changes.

How big is your tape?  Are you using compression?