- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Corrupted Files when used tar command
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
Discussions
Discussions
Forums
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
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-18-2006 11:16 AM
тАО07-18-2006 11:16 AM
Corrupted Files when used tar command
In my production line I typed:
u ;tar -cvf - . | (cd /u.sav ; tar -xvf -)
I did it under root and all the files in /etc got over written, SAM got corrupted, and vmunix got corrupted as well. Could you tell me why it is doing this?
Please advise,
Adrianne
- Tags:
- tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 12:05 PM
тАО07-18-2006 12:05 PM
Re: Corrupted Files when used tar command
mayhap it should have read
cd u ; tar cvf - .| (cd /u.sav ; tar xvf - )
which in my testing works fine.
if both the first and second cd failed, then you're trying to write the entire contents of your drive from wherever you currently are to wherever you currently are, which will probably result in the corruption you saw.
Why would the cd operations fail? The first directory u wasn't in the current directory (ie you were in / and u is actually under /tmp or some such) -- ditto for /u.sav -- if it is truly under / then fine, otherwise you need the full path to be safe.
hth
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 12:20 PM
тАО07-18-2006 12:20 PM
Re: Corrupted Files when used tar command
Keep your finger crossed.
Thanks,
Adrianne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 12:25 PM
тАО07-18-2006 12:25 PM
Re: Corrupted Files when used tar command
Hope not too much was lost between backup and restore. Last time I had to restore a production server from backup we lost about 23 employees work for most of a day (yikes!).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 12:47 PM
тАО07-18-2006 12:47 PM
Re: Corrupted Files when used tar command
You can protect yourself in situations like this by *only* performing the operation if the 'cd' is successful, thusly:
# ( cd /u && tar -cvf - . ) | ( cd /u.sav && tar -xvf - )
...Now, if either change-directory fails, nothing happens.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2006 02:50 AM
тАО07-19-2006 02:50 AM
Re: Corrupted Files when used tar command
Adrianne