AIX to SOLARIS conversion - (find -cmin option)


 
Thread Tools Search this Thread
Operating Systems Solaris AIX to SOLARIS conversion - (find -cmin option)
# 1  
Old 06-11-2008
AIX to SOLARIS conversion - (find -cmin option)

I have a piece of code (below) in a .ksh script running on AIX. I need to convert the code to run .zsh on Solaris. Solaris's find command does not support the -cmin function. Suggestions??

The code searchs for a file (_filename) and determines if it has been written to or modified in the last 5 minutes. If it has, it goes to sleep for 5 minutes and then checks again.

Code:
LOOP=1
  while [ ${LOOP} -eq 1 ]
  do
    find . -cmin -5 -name ${_filename} | read NEW_FILE
    if [ ! -z ${NEW_FILE} ]
    then
      echo "INFO: preprocess_dc: Time index "`date`". The file ${_filename} is less than five minutes old."
      echo "INFO: preprocess_dc: Waiting $vSleepTime seconds to verify the file is not still being written."
      sleep $vSleepTime
    else
      LOOP=0
    fi
  done


Last edited by Yogesh Sawant; 06-12-2008 at 02:20 AM.. Reason: added code tags
# 2  
Old 12-08-2008
I was not aware of this but Solaris 10's find(1) command does support cmin:
find(1) – find files (man pages section 1: User Commands) - Sun Microsystems

Otherwise you could use the -newer parameter, very crude .e.g:
$ touch /tmp/timer
$ sleep 300
$ find . -newer /tmp/timer -name ${_filename}

Last edited by TonyFullerMalv; 12-08-2008 at 06:39 PM.. Reason: Add help for Solaris not 10
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Prune Option for Find Command on AIX

I need to delete all files from the working directory and its sub directories using the find command, for that I am using -prune option but some how I am having a syntax issue. I have tried the below, please help me correct the syntax find . -name \* -type f -exec rm -f {} \; >> Works but... (4 Replies)
Discussion started by: rosebud123
4 Replies

2. UNIX for Beginners Questions & Answers

Any alternative for mmin or cmin parameter

Hi, I need to write a shell script where I need to check whether log file is generated in last 1 hour or not. But I am getting below error in using mmin or cmin parameter with find command: find: bad option -mmin find: bad option -cmin So my concern is that any alternative for mmin option... (5 Replies)
Discussion started by: Ankit Srivastav
5 Replies

3. Shell Programming and Scripting

Find mmin, mtime, cmin not working

Dear All, We are having the script which is creating the folder on another server if it is not present using ssh. Using scp it copies copy all pdf files from local folder to server folder. After all copy is done, Just to verify i was using the below find command find... (3 Replies)
Discussion started by: yadavricky
3 Replies

4. AIX

Enable large filesize option in NFS mount in AIX 4.3

Hi All, I have a NFS mount filesystem, however it is not supporting a creation of filesize greater than 2 GB in it, how can i enable the option (bf = true) in it. The AIX version is 4.3.2 Thanks in Advance!! (1 Reply)
Discussion started by: mad_man12
1 Replies

5. UNIX for Dummies Questions & Answers

AIX find command using prune option

Hi, I am trying to find some files in a directory and then remove/list them if they are 30 days old. I also have 2 directories in that directory which I need to skip. Can someone please tell me what is the correct syntax? find /developer/. -name "lost+found" "projects" -prune -o -type f... (2 Replies)
Discussion started by: tkhan9
2 Replies

6. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

7. UNIX for Dummies Questions & Answers

Relatively simple question regarding find and cmin

Nuts and bolts: I have a log file that should be updated once every minute called OD_MEM.log. I want to add a check to my CheckSystem script that confirms that the log has been written to in the last 2 minutes. If I use the find command with cmin 1, it finds the file every time. If I use the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

8. AIX

how to set AUTOCOMMIT option in AIX

Hi, Can anybody tell,how to set the auto commit option in AIX,i have tried with environmental variables option like 'export db2option=-c +a'. But its not working in my environment. is there any other option? (1 Reply)
Discussion started by: DB2AIX
1 Replies

9. UNIX for Advanced & Expert Users

find -cmin or fin -newer

I am running SUSE/8 and SUSE/9 on a high end server (4 CPU, 8G RAM etc) I have a huge directory structure with over 4million files in it. I have find the files that are modified (created, modified, renamed etc etc) in the last 10 minutes periodically. I have tried "find -cmin -10" and "find... (2 Replies)
Discussion started by: xxxyyyy
2 Replies

10. AIX

AIX 5L 64bits v5.3 Java option (Xjit)

Hi, I would like to know, we are using Oracle Application (E Business Suite) on AIX 5L 64bits v5.3. We have to add the -Xjit:count=0 to the java parameter for Oracle. I read the IBM AIX Guide but I can't figure out where or how to add that parameter. Anyone know how to do it? ... (0 Replies)
Discussion started by: Nayas
0 Replies
Login or Register to Ask a Question