- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- CPIO and logging copied files
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
Forums
Discussions
Discussions
Discussions
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
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
07-31-2003 06:08 AM
07-31-2003 06:08 AM
I want to backup some files and while each file is copied to tape, the file name is appended in a log file ( /files_ok.txt ) and if an error occurs it is appended in an error file, called /tmp/log.err. How can I do it ?
I try:
find / -depth -print | cpio -ovB -H newc 2>>/tmp/log.err >/dev/st0
but the list of files goes to /tmp/log.err. It??s so strange because I think it??s a stderr output ( 2>> ). I think I am having problems because I have to redirect the cpio output to tape but I just want to list the files that cpio made backup.
Any ideas ?
Cheers,
Mauro
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 06:18 AM
07-31-2003 06:18 AM
SolutionIf you want a list of what gets to tape somewhere else consider this.
commandline | tee /tmp/tapelist.log
This will have the output go two places, to tape as directed and a copy goes to the file you define.
tee is a very nice little tool.
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
07-31-2003 06:40 AM
07-31-2003 06:40 AM
Re: CPIO and logging copied files
The problem is when I did "find / -depth -print | cpio -ovB -H newc 2>>/tmp/log.err >/dev/st0" I received no messages in my terminal (tty), so I can not use tee... If I use tee it creates a empty file.
Cheers,
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 07:33 AM
07-31-2003 07:33 AM
Re: CPIO and logging copied files
find / -depth -print | cpio -ovB -H newc 2>>/tmp/log.err > find.results
I got a lot of results very quickly.
Is your environment(TERM, etc) normal when you are having these null results?
How about this:
find / -dept -print | cpio -ovB -H newc > /dev/st0
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
07-31-2003 09:11 AM
07-31-2003 09:11 AM
Re: CPIO and logging copied files
This is ok. The backup is made. The problem is I do not have a list of all the files that are on the tape...
I get success if I try to restore the backup but I do not know what files are in this tape and I and do not want in my script after the command listed that takes 2 hours running the tape having to do "cpio -ivt < /dev/st0 > /files_ok.txt and more 2 hours running the tape listing the files on it. I want to do it in just one time.
Thanks.
Cheers,
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 12:33 PM
07-31-2003 12:33 PM
Re: CPIO and logging copied files
Maybe though the | tee should be before the | cpio
Then just the filelist will go to tee and the filelist will be processed by the cpio command.
If I have time, I'll try and play with this on a linux box tonight.
If you are in a hurry, you can try it sooner.
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
07-31-2003 12:38 PM
07-31-2003 12:38 PM
Re: CPIO and logging copied files
Yes, you should add the "| tee" after find
command and the output of tee pipe to the
cpio command.
Just like SEP wrote.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 04:19 PM
07-31-2003 04:19 PM
Re: CPIO and logging copied files
find . -print0 | cpio -0ovC10240 -H newc -O /dev/nst0 2> output.log
Use '-O' to output to the device, rather than use STDOUT to make less confusion. Unfortunately as errors also come out on STDERR, there's no real way to separate them. The STDOUT of cpio however does have some 'information' messages, depending on the flag syou use.
much fun ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 08:29 AM
08-01-2003 08:29 AM
Re: CPIO and logging copied files
It??s working now, with tee.
Cheers,
Mauro