GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar error checkng
Operating System - HP-UX
1847686
Members
4396
Online
110265
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
04-13-2004 11:03 PM
04-13-2004 11:03 PM
I want to use tar to backup the files ( tar -cvf ), could suggest how to have the error checking , eg . if the directory is not exist , the backup process is failure , then generate the error message to the log , could suggest what can I do ? thx
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2004 11:07 PM
04-13-2004 11:07 PM
Solution
tar cvf tarfile.tar *
rc=$?
if [ $rc -ne 0 ] then
echo "error bad tar."
else
echo "good tar"
fi
Add additional code as required.
SEP
rc=$?
if [ $rc -ne 0 ] then
echo "error bad tar."
else
echo "good tar"
fi
Add additional code as required.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
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
04-13-2004 11:11 PM
04-13-2004 11:11 PM
Re: tar error checkng
Hi,
You can redirect stout and sterr to a logfile
tar cvf .... > outputfile 2 >&1
then check the logfile for errors(grep) and generate some error in your script using "logger". In this way you errors can be in the syslog file or someother you can define in syslog.conf.
HTH,
Peter
You can redirect stout and sterr to a logfile
tar cvf .... > outputfile 2 >&1
then check the logfile for errors(grep) and generate some error in your script using "logger". In this way you errors can be in the syslog file or someother you can define in syslog.conf.
HTH,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2004 03:00 AM
04-14-2004 03:00 AM
Re: tar error checkng
HI
You can simply redirect the output of the tar command to a file by using the ">" symbol and specifying a file name where the output of the tar command will be written
You can simply redirect the output of the tar command to a file by using the ">" symbol and specifying a file name where the output of the tar command will be written
I have been betrayed by our own People
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP