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 find command with cmin 2 it does not find the file. Is the cmin option looking for files modified exactly n minute ago, or within the last n minute. Meaning if I use cmin 2, shouldn't it find files modified within the last 2 minutes, which would include the file I'm looking for (since it was modified 1 minute ago).
Now, just in case you'd like to laugh at how hard I worked on this before I realized I could just use find to check the modified time...
My original plan was to calculate how many lines there should be in the log based on the premise that for every hour there would be 60 lines and then in the latest hour add the number of minutes and compare it against the actual number of lines. It actually works, but I realize now it's an incredibly convoluted solution, so I'm hoping to better understand the find command and replace it.
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)
Cheers!
In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not?
To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
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)
I am having trouble making this statement work. I am passing in a number value for the number of days to keep archive logs for and wanted to make sure that it is a number. I have a script that will return 1 for is a number and 0 for is not a number. I also want to make sure that the number is not... (2 Replies)
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... (1 Reply)
I had a script in solaris wich i read data, for example:
Number 1: _
and the cursor use to be in '_' place because in the code of the script i write:
echo "Number 1:\c"
but i copy the script to a linux and the cursor 'jump' to the begining of the next line like:
Number 1:... (2 Replies)
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)
Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
I am taking an intro to unix class and I can not figure out how to do part of the question. I am writing script to be exictued by a program in the tutoral.
Question:
Write every line containing the word ``delete'' produced by ``man mail'' into a file called ``delete''. Hint: What does using... (1 Reply)