find command - mtime/ctime calc - Redhat

This is a discussion on find command - mtime/ctime calc - Redhat ; Hi, i got this problem, suppose these files : $ cd /oraarc $ ls -lgo May 29 19:08 20060529190001.expfull.ahd.log May 29 19:08 20060529190001.expfull.ahd.Z May 30 12:06 20060530120001.expfull.ahd.log May 30 12:06 20060530120001.expfull.ahd.Z May 30 19:23 20060530190001.expfull.ahd.log May 30 19:23 20060530190001.expfull.ahd.Z May ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: find command - mtime/ctime calc

  1. find command - mtime/ctime calc

    Hi,
    i got this problem, suppose these files :

    $ cd /oraarc
    $ ls -lgo
    May 29 19:08 20060529190001.expfull.ahd.log
    May 29 19:08 20060529190001.expfull.ahd.Z
    May 30 12:06 20060530120001.expfull.ahd.log
    May 30 12:06 20060530120001.expfull.ahd.Z
    May 30 19:23 20060530190001.expfull.ahd.log
    May 30 19:23 20060530190001.expfull.ahd.Z
    May 31 12:23 20060531120001.expfull.ahd.log
    May 31 19:15 20060531190001.expfull.ahd.log
    Jun 1 12:23 20060601120002.expfull.ahd.log
    Jun 1 12:23 20060601120002.expfull.ahd.Z
    Jun 1 19:23 20060601190001.expfull.ahd.log

    now is Fri Jun 2 10:46:12 BRT 2006 and i do a couple of find commands
    :
    $ find /oraarc -name "*expfull*" -mtime +2 -exec ls -lgo {} \;
    -rw-r--r-- 1 63264 May 29 19:08 /oraarc/20060529190001.expfull.ahd.log
    -rw-r--r-- 1 1208430592 May 29 19:08
    /oraarc/20060529190001.expfull.ahd.Z
    $ find /oraarc -name "*expfull*" -ctime +2 -exec ls -lgo {} \;
    find: /oraarc/lost+found: Permission denied
    -rw-r--r-- 1 63264 May 29 19:08 /oraarc/20060529190001.expfull.ahd.log
    -rw-r--r-- 1 1208430592 May 29 19:08
    /oraarc/20060529190001.expfull.ahd.Z

    the questions are :
    * why files from Jun,30 are not catched by the commands ?
    * what am i doing wrong, if so ?

    thanks,
    Sandro.


  2. Re: find command - mtime/ctime calc

    look that , cmin / mmin works better :

    $ find /oraarc -name "*expfull*" -mmin +2880
    find: /oraarc/lost+found: Permission denied
    /oraarc/20060529190001.expfull.ahd.log
    /oraarc/20060529190001.expfull.ahd.Z
    /oraarc/20060530120001.expfull.ahd.log
    /oraarc/20060530120001.expfull.ahd.Z
    /oraarc/20060530190001.expfull.ahd.log
    /oraarc/20060530190001.expfull.ahd.Z
    $ find /oraarc -name "*expfull*" -cmin +2880
    find: /oraarc/lost+found: Permission denied
    /oraarc/20060529190001.expfull.ahd.log
    /oraarc/20060529190001.expfull.ahd.Z
    /oraarc/20060530120001.expfull.ahd.log
    /oraarc/20060530120001.expfull.ahd.Z
    /oraarc/20060530190001.expfull.ahd.log
    /oraarc/20060530190001.expfull.ahd.Z

    it seems that mtime / ctime is doing something wrong with the hours.


+ Reply to Thread