- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Delete Script
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
07-18-2003 11:37 AM
07-18-2003 11:37 AM
Delete Script
find /backup_files -name 'branch_file*' -type f -xdev -mtime +60 -exec rm {} \;
This removes only files that are modified between 1416 hours(59th day) and 1440 hours (60th days) back.
But i also want to delete files that was accessed 2 yrs back. So i need a generalized
script which deletes all files older(modified) than 2 months.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2003 11:43 AM
07-18-2003 11:43 AM
Re: Delete Script
This post covers what you require:-
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5a4135a43b46d71190080090279cd0f9,00.html
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2003 11:53 AM
07-18-2003 11:53 AM
Re: Delete Script
It only works with cron, ie no terminal. You will have to hack it to make it work with a TERM session. Its not hard though.
It uses a configuration file that lets you limit what directories it can touch. Just include the folder or filesystem name.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2003 11:54 AM
07-18-2003 11:54 AM
Re: Delete Script
It only works with cron, ie no terminal. You will have to hack it to make it work with a TERM session. Its not hard though.
It uses a configuration file that lets you limit what directories it can touch. Just include the folder or filesystem name.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2003 12:34 PM
07-18-2003 12:34 PM
Re: Delete Script
You might try this modification:
# find /backup_files -xdev \( -type f -a -name "branch_file*" -a -mtime +60 \) -exec rm {} \;
Note that spaces follow the open parentheses and precede the close parentheses. Note, too, that the parentheses must be escaped.
Regards!
...JRF...