- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- deleting old files by date
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
тАО07-28-2004 03:31 AM
тАО07-28-2004 03:31 AM
deleting old files by date
find /opt/oracle/SID/bdump -type f -mtime +10
-exec rm{} \;
Of course, I want to get a listing before I remove files. When I execute this command, I don't get any results.
find /opt/oracle/SID/bdump -type f -mtime +10
-exec ls{} \;
I have files dated today, Feb/March 2004 and Dec 2003.
These command worked for me when I worked at another agency 2 years ago.
Thanks in advance for your assistance.
Yvette
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:36 AM
тАО07-28-2004 03:36 AM
Re: deleting old files by date
The command is OK. You wont get any files, if you do not have any rights on them.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:37 AM
тАО07-28-2004 03:37 AM
Re: deleting old files by date
Generating a listing can be done with-
find /opt/oracle/SID/bdump -type f -mtime +10 -print
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:37 AM
тАО07-28-2004 03:37 AM
Re: deleting old files by date
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:42 AM
тАО07-28-2004 03:42 AM
Re: deleting old files by date
find /opt/oracle/SID/bdump -type f -mtime +10
-exec ls{} \; will give the modified files over within 10*24 hours limit.
Use find /opt/oracle/SID/bdump -type f -mtime +10
-exec ls -a{} \; to know more about the files informations.
what is ll -a command saying. If it is showing the files with in the duration,it will make it out.
IF you have files in ls command listing then it will delete those file(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:42 AM
тАО07-28-2004 03:42 AM
Re: deleting old files by date
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-28-2004 04:00 AM
тАО07-28-2004 04:00 AM
Re: deleting old files by date
To RAC - I├в m using Oracle login. Files are owned by Oracle.
To Rodney and Jeff ├в I used the ├в print command, works!
Now, how can I make sure that my current file dated today won├в t be included when I execute the remove comm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 04:11 AM
тАО07-28-2004 04:11 AM
Re: deleting old files by date
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 04:25 AM
тАО07-28-2004 04:25 AM
Re: deleting old files by date
Nice job is done by chaining -exec - it does your job your way.
Try this:
#find /opt/oracle/SID/bdump -type f -mtime +10 -exec rm{} \; -exec ls{} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 04:28 AM
тАО07-28-2004 04:28 AM
Re: deleting old files by date
#!/bin/sh
#
# Geoff Wild
# April 16 2004
#
# Script to remove the old data for the PCT
# setup the log file
LOG=/tmp/pct.clean.log
if [ -f $LOG ]
then
mv $LOG $LOG.old
fi
cat /dev/null > $LOG
# setup an array of directories to search
set -A DIR "/APPL/sp/retail/poscod/report" "/APPL/sp/retail/pospass/report" "/APPL/sp/tax/cask/ib/archive" "/APPL/sp/tax/cask/ob/archive" "/APPL/sp/tax/caab/ib/archive" "/APPL/sp/tax/caab/ob/archive" "/APPL/sp/whxlinter/archive" "/APPL/sp/whxlinter/reject"
# remove files older then 31 days
for i in ${DIR[@]}
do
find $i -type f -mtime +31 -print -exec rm {} \; >>$LOG
done
Rgds...Geoff