- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Good old rm
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
тАО11-23-2006 03:07 AM
тАО11-23-2006 03:07 AM
Here is a breif description of the point. I have a demo system that I restore production data to. I use data protector 5.5 and when restoring I alway select restore to a new location (this is a must). So on demo I restore prod data to say a mount point
/fpc/temp
When the data is restored it goes into /fpc/temp/fpc/temp I would like to move everything from /fpc/temp/fpc/temp to /fpc/temp and then rm the /fpc/temp/fpc folder. Is this the best and safest way?
cd /fpc/temp/fpc/temp
mv * /fpc/temp
cd /fpc/temp && rm -rf fpc
Thanks Everyone
Solved! Go to Solution.
- Tags:
- Data Protector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2006 03:13 AM
тАО11-23-2006 03:13 AM
Re: Good old rm
how about:
cd /fpc/temp/fpc/temp
# Create a tar of all the files with relative path
tar -cvf /fpc/tar.lis *
cd /fpc/temp
# Check the right was data backed up
tar -tvf /fpc/tar.lis
# Clear all the files
rm -r /fpc/temp/fpc
# Restore the files
tar -xvf /fpc/tar.lis
Benefit : You still have all the data if anything did go wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2006 03:13 AM
тАО11-23-2006 03:13 AM
SolutionSafest and using -f in the next sentence are mutaly exclusive.
>> cd /fpc/temp && rm -rf fpc
I would change that to tow commands:
rmdir /fpc/temp/fpc/temp
rmdir /fpc/temp/fpc
That would show you know what you are doing and give you a warning if there is a surprise.
Just my opinion.
Cheers,
Hein.
- Tags:
- rmdir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2006 03:14 AM
тАО11-23-2006 03:14 AM
Re: Good old rm
There are 2 choices "restore into" or "restore as" I don't remember which is which but choose the other one that you are using now and you will avoid duplicating the directory tree and having to fix it afterwards like you are trying to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2006 03:19 AM
тАО11-23-2006 03:19 AM
Re: Good old rm
So you are not actually moving data, just directory entries. Pretty safe, and a tar seems a bit much, notably if the data could be re-restored if anything would go wrong.
Actually i would probably solve it with just:
ls /temp
mv /fpc/temp/fpc/temp /fpc/temp2
rmdir /fpc/temp/fpc
rmdir /fpc/temp
mv /fpc/temp2 /fpc/temp
no wildcard to make you go wildly wrong,
no force
minimimal system resources used.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2006 04:06 PM
тАО11-23-2006 04:06 PM
Re: Good old rm
It would better if you fix the restore problem instead! Restore the files to the right location and avoid the risks of making an error and extra tasks...
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2006 02:54 AM
тАО11-24-2006 02:54 AM
Re: Good old rm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2006 03:12 AM
тАО11-24-2006 03:12 AM
Re: Good old rm
In the past someone used the over write and restored it to production instead of demo. Thus we are no longer allowed overwrite. You have to restore to an alternate location and move the data in. It is a demo system so if the script craps out it is no biggy
I know, not my rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2006 03:44 AM
тАО11-24-2006 03:44 AM
Re: Good old rm
and the correct option to avoid duplicating the directory tree.
You can create a directory say /tmp/restore
(with enough space there to hold your restored data)Then in DP you chose that dir as your destination.
Let say you are restoring the file /home/joe/abc.txt, if you choose the "restore into" option in DP your file will be restored as /tmp/restore/home/joe/abc.txt
If you choose the "restore as" option you will end up with /tmp/restore/abc.txt and will not have to fix it afterwards.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2006 03:50 AM
тАО11-24-2006 03:50 AM