- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script To delet the file periodically
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
03-28-2008 10:38 PM
03-28-2008 10:38 PM
Script To delet the file periodically
we are using HP UX 11.11 and one of the incoming data folder contains files which is get created in the folder twice a day.Now My requirement is to delete the which was created 15 days back and it should happend every day.
So i would appriciate if you can provide me some script for the same.
Incase if you are not able to under stand my concern let me know i will agian try to explan it agin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2008 11:05 PM
03-28-2008 11:05 PM
Re: Script To delet the file periodically
First, create your script which should like the following:
#!/bin/sh
#Script Name: /home/yogeeraj/scripts/purge_script.sh
DATAPATH=
CRITERIA="'
find $DATAPATH -xdev -type f -mtime +15 -name $CRITERIA -exec rm -f {} \ ;
#End
then schedule the script using CRON.
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
30 01 * * * /home/yogeeraj/scripts/purge_script.sh 1>
/home/yogeeraj/scripts/logfiles/output-purge_script.crn 2>/home/yogeeraj/scripts/logfiles/error-purge_script.crn
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
if you need any further clarifications, please let us know
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2008 11:10 PM
03-28-2008 11:10 PM
Re: Script To delet the file periodically
You should also replace "\;" by "+" for performance.
so the script should be changed as follows:
find $DATAPATH -xdev -type f -mtime +15 -name $CRITERIA -exec rm -f {} +
sorry for inconveniences
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2008 12:46 AM
03-30-2008 12:46 AM
Re: Script To delet the file periodically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2008 12:47 AM
03-30-2008 12:47 AM