- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Clear logs
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
02-20-2008 01:59 PM
02-20-2008 01:59 PM
I am doing some housekeeping and clearing up some archived logs ,firstly I am using the pax command to copy stuff over so that I can copy the directory structure also. Then I issue the rm command after the job is completed to clear up space.
Here is what I am doing :
nohup /usr/bin/pax -rw bo/app/*2006* /logsfs/logs/archive/prod &
and then the rm command :
rm -fr *2006*
Can I do this in one single piped command.
Please suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2008 02:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2008 02:37 PM
02-20-2008 02:37 PM
Re: Clear logs
Thanks JRF!
And what if I need to have it mail me once done with pax and rm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2008 03:34 PM
02-20-2008 03:34 PM
Re: Clear logs
> And what if I need to have it mail me once done with pax and rm.
You could simply do:
# /usr/bin/pax -rw bo/app/*2006* /logsfs/logs/archive/prod && { rm -fr *2006*; mailx -s "Logs cleared" root < /dev/null; }
That is, if the 'pax' is successful; run the subshell process which removes the logs and mails the 'root' user a message.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2008 05:33 PM
02-20-2008 05:33 PM
Re: Clear logs
I would want to run all this as nohup though.