- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find + mtime + newer
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
12-13-2004 01:25 AM
12-13-2004 01:25 AM
I am trying to write a script to gzip archive log files created today, I need it to run every 10 minutes as the database does a lot of processing.
I don't want to gzip the file that it is currently writing to, I have tried using variations of find but I can't get it to do exactly what I want.
find /archivelog -mtime 0 gives me all the files but I would to get all bar the most recent one.
Any ideas on a simple way of doing this??
Thanks in advance,
Barbara
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 01:36 AM
12-13-2004 01:36 AM
Re: find + mtime + newer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 01:37 AM
12-13-2004 01:37 AM
Re: find + mtime + newer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 01:37 AM
12-13-2004 01:37 AM
Re: find + mtime + newer
Oracle archive logs have a simple numbering convention which you partly specify in the initXXX.ora file.
It should be trivial to remember the last file processed no? In a (shell/perl) loop generate the next file and stat it to check it to compare its mtime, ctime and atime?
How long does it take to write the archive logs? How about every time in the loop you 'touch' a marker file. Then find all files NOT newer than the marker and those are candidates.
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 01:43 AM
12-13-2004 01:43 AM
Solutiontry the following
2004 ---year
12 ----month
13 -----date
10 & 11 hour
10 & 15 min
touch -t 200412131010 start
(it will create a file with time stamp 13/12/2004 and time 10.10am)
touch -t 200412131115 stop
(it will create a file with time stamp 13/12/2004 and time 11.15am)
then
#find /home/hpadm -newer start -a ! -newer stop
this will find the files created between 10.10 and 11.15
by script you can change the time stamp of start and stop files and can be used for finding files between that times.
regds,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 01:59 AM
12-13-2004 01:59 AM
Re: find + mtime + newer
redo archive logs are written one by one,
that means only one file is actually written and that is the newest one.
To find all files without having the actual one you only have to list the dir ordered by last modfication time and skip the first one:
for file in $(ls -t | tail +2)
do
gzip $file
done
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2004 02:05 AM
12-13-2004 02:05 AM