- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Purge old directories on Ignite server
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
09-21-2006 03:23 AM
09-21-2006 03:23 AM
Example:
# ll
total 24
drwxr-xr-x 2 bin bin 4096 Aug 11 15:39 2006-08-11,15:36
drwxr-xr-x 2 bin bin 4096 Aug 18 08:19 2006-08-18,07:53
-rw-r--r-- 1 bin sys 290 Aug 18 08:19 client_status
lrwxr-xr-x 1 bin bin 16 Aug 18 07:53 latest -> 2006-08-18,07:53
make_net_recovery won't delete old directories and just creates new one and links to latest. I have 100 hosts whose backups are stored on Ignite server. Don't want to do manually.
I want to keep latest two directories only.
BTW, archive images are stored on /archives directory and I run make_net_recovery to keep two images on this directory with -n 2 option.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2006 03:42 AM
09-21-2006 03:42 AM
SolutionYou could simply select the directories in timestamp sequence:
# ls -lt /var/opt/ignite/clients/`hostname`/recovery | grep "^d" | tail +3
...look only for directories and trim the list to the ones you want to remove.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2006 03:48 AM
09-21-2006 03:48 AM
Re: Purge old directories on Ignite server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 04:03 AM
09-29-2006 04:03 AM
Re: Purge old directories on Ignite server
anyway, I want to automate the following script for a bunch of 30 hosts.
I tried this way but not working.
for i in `cat hosts.txt`
do
ls -lt /var/opt/ignite/clients/$i/recovery | grep "^d" |tail +3 |awk
'{print $9}' |xargs -n 1 rm -rf
done
I know rm isn't taking absolute path. How do I modify above script to read absolute path?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 04:16 AM
09-29-2006 04:16 AM
Re: Purge old directories on Ignite server
for i in `cat hosts.txt`
do
cd /var/opt/ignite/clients/$i/recovery
ls -lt | grep "^d" |tail +3 |awk
'{print $9}' |xargs -n 1 rm -rf
done
Regards,
Yang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 04:23 AM
09-29-2006 04:23 AM
Re: Purge old directories on Ignite server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 04:23 AM
09-29-2006 04:23 AM
Re: Purge old directories on Ignite server
For you 'xargs' use:
...
# xargs -i rm -rf $PWD/{}
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 04:25 AM
09-29-2006 04:25 AM