HPE GreenLake Administration
Operating System - HP-UX
1834461
Members
2983
Online
110067
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
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
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
01-15-2003 12:21 AM
01-15-2003 12:21 AM
Tar
I want the tar function to backup, I try to tar a non-existing file , but the system output is still "0" , can suggest what is wrong ? thx.
my tar script is:
tar -cvf /dev/tape /tmp/tar.txt
if [ $? -eq 0 ]
then echo "successful"
else
echo "fail"
fi
but the result is "0" even the file "/tmp/tar.txt" is not existing.
my tar script is:
tar -cvf /dev/tape /tmp/tar.txt
if [ $? -eq 0 ]
then echo "successful"
else
echo "fail"
fi
but the result is "0" even the file "/tmp/tar.txt" is not existing.
Juno
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 01:03 AM
01-15-2003 01:03 AM
Re: Tar
Hi,
The /tmp/tar.txt must exist, it is this file you try to backup.
try
tar cvf
The /tmp/tar.txt must exist, it is this file you try to backup.
try
tar cvf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 01:13 AM
01-15-2003 01:13 AM
Re: Tar
Hi,
I had the same problem with the return code of tar.
A solution is to control the backup using tar -tvf /dev/tape an comparing the output with the list of the expected files.
# find -type f > list.txt
# cat list.txt | sort -u > list.expected
# tar -cvf /dev/tape
# tar -tvf /dev/tape > list.txt
# cat list.txt | sort -u > list.tar
# diff list.expected list.tar
Fr??d??ric
I had the same problem with the return code of tar.
A solution is to control the backup using tar -tvf /dev/tape an comparing the output with the list of the expected files.
# find
# cat list.txt | sort -u > list.expected
# tar -cvf /dev/tape
# tar -tvf /dev/tape > list.txt
# cat list.txt | sort -u > list.tar
# diff list.expected list.tar
Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 01:59 AM
01-15-2003 01:59 AM
Re: Tar
Hi,
This problem is present in my instalation just in 10.20 however in 11.0 works fine, but this is not a tar error because if you put an "echo $?" after tar command you must see return code 5. So the problem is the if value validation, may be needs a cumulative command patch. However I recomend you this routine:
tar -cvf /dev/tape /tmp/tar.txt
STATUS=$?
case $STATUS in
0) echo "Successful"
;;
*) echo "Fail with status: $STATUS"
;;
esac
Rgds.
This problem is present in my instalation just in 10.20 however in 11.0 works fine, but this is not a tar error because if you put an "echo $?" after tar command you must see return code 5. So the problem is the if value validation, may be needs a cumulative command patch. However I recomend you this routine:
tar -cvf /dev/tape /tmp/tar.txt
STATUS=$?
case $STATUS in
0) echo "Successful"
;;
*) echo "Fail with status: $STATUS"
;;
esac
Rgds.
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 2025 Hewlett Packard Enterprise Development LP