Problem
When running a cpio backup using cron, I see the following error message;
"cpio: can't open /dev/tty for writing"Why does this happen? Cause
Some programs issue messages to stdout via the /dev/tty device.
/dev/tty is a special file that is always the controlling terminal, even when standard input and standard output have been redirected.
Solution
A common program that writes to /dev/tty is cpio: if it needs another volume (tape or floppy is full), it writes to /dev/tty asking you to give it the name of another device it can write on. Therefore, cpio scripts put into background / cron can generate this kind of message.
If you want to see the actual message (and you are using OSR5+) try adding the "-P0,1" flag to cpio;
e.g. find . -print | tee /etc/backup.list | cpio -oBc
-P0,1 $TAPEDEVIf you are getting this at the command line, the permissions on /dev or /dev/tty itself may be wrong.