- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: Incorrect find * -ctime +7
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-11-2007 09:05 PM
02-11-2007 09:05 PM
Incorrect find * -ctime +7
I removed my old system logs (syslog.dated) by default system cron shell command:
find /var/adm/syslog.dated/* -depth -type d -ctime +7 -exec rm -rf {} \;
Recently the find command didn't run correctly with key -ctime.
It find nothing when i am runnig:
# find /var/adm/syslog.dated/* -depth -type d -ctime +7
but it find files changed in the past 7 days when i am runnig:
# ls -lt
total 432
drwxr-xr-x 2 root adm 8192 Feb 12 08:53 12-Feb-08:53
lrwxr-xr-x 1 root adm 12 Feb 12 08:53 current -> 12-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 11 08:53 11-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 10 08:53 10-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 9 08:52 09-Feb-08:52
drwxr-xr-x 2 root adm 8192 Feb 9 03:01 09-Feb-03:01
drwxr-xr-x 2 root adm 8192 Feb 8 03:00 08-Feb-03:00
drwxr-xr-x 2 root adm 8192 Feb 7 03:00 07-Feb-03:00
drwxr-xr-x 2 root adm 8192 Feb 6 02:59 06-Feb-02:59
drwxr-xr-x 2 root adm 8192 Feb 5 02:59 05-Feb-02:59
drwxr-xr-x 2 root adm 8192 Feb 4 02:58 04-Feb-02:58
drwxr-xr-x 2 root adm 8192 Feb 3 02:58 03-Feb-02:58
...
What was happening? How repair this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2007 11:50 PM
02-11-2007 11:50 PM
Re: Incorrect find * -ctime +7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 02:28 PM
02-12-2007 02:28 PM
Re: Incorrect find * -ctime +7
Yes, it functions fine really!
But why have used the default cron command -ctime instead of -mtime? Is default cron command incorrect?
# grep find /var/spool/cron/crontabs/root
40 4 * * * find /var/adm/syslog.dated/* -depth -type d -ctime +7 -exec rm -rf {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 03:20 PM
02-12-2007 03:20 PM
Re: Incorrect find * -ctime +7
>> Yes, it functions fine really!
Of course! You did not really think something so fundamental would be broken, did you?!?
>> But why have used the default cron command -ctime instead of -mtime?
Probably because the test is on a Directory, not a common datafile for which -mtime is the common test.
The missing information in the base topic it the output from 'ls -ltc' vs plain 'ls -lt'.
The base topic shows the plain -lt which corresponds with 'mtime'.
Had the -ltc output been requested, then the consistency of the find would surely have become clear.
>> Is default cron command incorrect?
Are you use it is a default, Tru64 command, not just a commonly used command set up by a sysadmin in long forgotten times?
Note, I'm not saying you are right or wrong, I simply did not know Tru64 provided this 'out of the box'. Next time I'll boot my Tru64 setup I'll have to look!
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 04:17 PM
02-12-2007 04:17 PM
Re: Incorrect find * -ctime +7
Yes, i am using default.
In really i can see time of last inode modification is a current day!
# ls -ltc
total 440
drwxr-xr-x 2 root adm 8192 Feb 13 08:54 13-Feb-08:54
lrwxr-xr-x 1 root adm 12 Feb 13 08:54 current -> 13-Feb-08:54
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 01-Feb-02:57
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 02-Feb-02:58
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 03-Feb-02:58
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 04-Feb-02:58
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 05-Feb-02:59
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 06-Feb-02:59
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 07-Feb-03:00
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 08-Feb-03:00
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 09-Feb-03:01
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 09-Feb-08:52
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 10-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 11-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 12-Feb-08:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 17-Jan-02:51
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 18-Jan-02:51
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 19-Jan-02:52
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 20-Jan-02:52
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 21-Jan-02:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 22-Jan-02:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 23-Jan-02:53
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 24-Jan-02:54
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 25-Jan-02:54
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 26-Jan-02:55
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 27-Jan-02:55
drwxr-xr-x 2 root adm 8192 Feb 13 04:12 28-Jan-02:55
....
I don't know, why is inode time modifieing every day?
I have one more Tru64 server, when i can see different result of commant 'ls -ltc':
# ls -ltc
total 56
drwxr-xr-x 2 root adm 8192 Feb 12 16:48 12-Feb-16:48
lrwxr-xr-x 1 root adm 12 Feb 12 16:48 current -> 12-Feb-16:48
drwxr-xr-x 2 root adm 8192 Feb 11 16:48 11-Feb-16:48
drwxr-xr-x 2 root adm 8192 Feb 10 16:43 10-Feb-16:43
drwxr-xr-x 2 root adm 8192 Feb 9 16:43 09-Feb-16:43
drwxr-xr-x 2 root adm 8192 Feb 8 16:42 08-Feb-16:42
drwxr-xr-x 2 root adm 8192 Feb 7 16:42 07-Feb-16:42
drwxr-xr-x 2 root adm 8192 Feb 6 16:42 06-Feb-16:42
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 11:17 PM
02-12-2007 11:17 PM
Re: Incorrect find * -ctime +7
So now we are getting somewhere.
The original find now even more clearly did the right thing by not finding anything older than x days because eevrythign was touched 'today'
The subtle question of whether to use ctime or mtime is now moot and replaced by a much more concrete question:
Which script is modifying the syslog.dated sub directory every single day @ 4:12 in the morning, on this one system.
The cron files will surely point to just a few scripts to verify.
Is one of them re-trying to compress some content of all the sub directories every day? Or doing a cd into them and running a report? Or for some reason beyond or current comprehension issueing a 'touch'?
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2007 10:40 PM
02-13-2007 10:40 PM