mtime command erroring


 
Thread Tools Search this Thread
Operating Systems AIX mtime command erroring
# 1  
Old 10-19-2010
Network mtime command erroring

I am calling this paramters from a controlfile

Code:
CONTROLFILE="/u01/scripts/admin/filesystem.ctl"
SEARCH_PATH="`grep SEARCH_PATH $CONTROLFILE | awk -F: '{print $2}' `"
FILE_TYPE="`grep FILE_TYPE $CONTROLFILE | awk -F: '{print $2}' `"
DEL_RETENTION_SIZE="`grep DEL_RETENTION_SIZE $CONTROLFILE | awk -F: '{print $2}' `"

find $SEARCH_PATH/$FILE_TYPE -mtime +$DEL_RETENTION_SIZE

getting this error.

Code:
[oracle@jk1] $ find $SEARCH_PATH/$FILE_TYPE -mtime +$DEL_RETENTION_SIZE
find: 0652-086 Specify a decimal integer for -mtime
Usage: find [-H | -L] Path-list [Expression-list]

when running like this its running without issues
Code:
find $SEARCH_PATH/$FILE_TYPE -mtime +10

Moderator's Comments:
Mod Comment Use code tags please - you got a PM that explains how to use them.

Last edited by zaxxon; 10-22-2010 at 04:33 AM.. Reason: User ignored request to change topic - so I did that
# 2  
Old 10-19-2010
Well, you should log an error and exit if [ "$DEL_RETENTION_SIZE" = "" ]!
# 3  
Old 10-19-2010
can i have the exact command if possible
# 4  
Old 10-19-2010
@javeedkaleem

Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.


Thank you.

The UNIX and Linux Forums
# 5  
Old 10-19-2010
PS: I never like excess use of the clock, like mtime, for archiving. Pick a real date, touch CCYYMMDD0000 marker_file, and use find ! -newer marker_file. The results are repeatable and so testable, and you can tell users you archive files before CCYYMMDD.
# 6  
Old 10-19-2010
Thanks for your quick response
it worked
Code:
find $SEARCH_PATH/$FILE_TYPE -mtime +"$DEL_RETENTION_SIZE"

i got the result which i was looking.

---------- Post updated at 11:17 AM ---------- Previous update was at 11:14 AM ----------

need one more help if this command didnt returned any results as there may be no data
then i want to echo this message is there any way to do it
Code:
echo "No files found older then $DEL_RETENTION_SIZE Days old."

your help is really appreciated.

Kaleem

Moderator's Comments:
Mod Comment Again, use code tags, thanks.

Last edited by zaxxon; 10-26-2010 at 07:00 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX - find command with mtime

Hello experts, I would get from a list of files, which are more ancient than 1 hour. Examples: Current date: Wed Oct 28 16:10:02 SAT 2015 using: find path -name 'file_name. *' -mtime +0 I see files with less at 00:00:00 date of the current day. /path/file_name.20151027170725... (7 Replies)
Discussion started by: carlino70
7 Replies

2. UNIX for Advanced & Expert Users

Passing Variable in -mtime command

Hi, As the process of log cleanup, Im using the below command find $DIR -mtime +3 -type f -exec gzip {} \; The problem is I want to pass +3 as variable in my unix shell. I have defined ZPDATE=+3 in my properties file and calling this property file in my script. If i try the... (6 Replies)
Discussion started by: Deena1984
6 Replies

3. Shell Programming and Scripting

awk problem - erroring out - unexpected token

can anyone help identify where the issue is here? awk 'BEGIN { c="perl -e 'print scalar(localtime("'${EPOCHTIME}'")), "\n"'"; c|getline; close( c ); print $2" "$3" "$4" "$6; }' bash: syntax error near unexpected token `(' can't seem to figure it out. i tried this: awk 'BEGIN {... (5 Replies)
Discussion started by: SkySmart
5 Replies

4. Red Hat

-mtime command

Hello, what this command do. find /oracle/u01/app/oracle/admin/rdz/udump/ -name "*.trc" -mtime +1 Thanks, Umair (1 Reply)
Discussion started by: umair
1 Replies

5. Shell Programming and Scripting

What is -mtime 0 in find command?

What is "-mtime 0" option in find command. Does it consider the files that are of today lets say today is 4th Aug or will include files 24 hrs past from the current time???? (3 Replies)
Discussion started by: sachinkl
3 Replies

6. UNIX for Dummies Questions & Answers

(find) mtime vs. (unix) mtime

Hi I've made some test with perl script to learn more about mtime... So, my question is : Why the mtime from findfind /usr/local/sbin -ctime -1 -mtime -1 \( -name "*.log" -o -name "*.gz" \) -print are not the same as mtime from unix/linux in ls -ltr or in stat() function in perl : stat -... (2 Replies)
Discussion started by: hiddenshadow
2 Replies

7. Shell Programming and Scripting

1 script 8 boxes and it is erroring on 3 of them

am trying to place a script from one hp11-unix box (where it works) onto three others where it won't. I am using csh and in the script I use the lines set F_SYSTEMS=(/dbs01 /dbs02 /dbm01 /dbm02 /ora_home/app/oracle) on this one the three others throw up on pulling the files. there should be... (2 Replies)
Discussion started by: cat55
2 Replies

8. UNIX for Advanced & Expert Users

DISPLAY variable erroring when installing Oracle 10g.

Hi, I'm trying to install Oracle 10g in Solaris 10. As required in the instructions, I set the DISPLAY variable: $ DISPLAY=192.168.150.128:0.0 ; export DISPLAY when run the runInstaller in a terminal, it displays an error related to DISPLAY variable. :( Any ideas?? Thanks. (2 Replies)
Discussion started by: ffpradella
2 Replies

9. UNIX for Dummies Questions & Answers

Problem with find command when used with mtime

All, Please find the below comand . I am trying to list the file that has not been accesed is past 14 days . But when you look at the display the directory "crecv1" which has date as today is displayed .. Why it is happening . I send this code instead of ls -ltr as rm -f -r in production... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

10. Shell Programming and Scripting

Need a help in the Shell script which is erroring out

Hi all I want to add this line after a line This is the line which needs to be add after the word permission echo 'profile: /export/home/unix1/auto.pr' >> $xxyy if ;then cd $unixserv/unix sed ' /permission/ a\ echo 'profile: /export/home/unix1/auto.pr' >> $xxyy... (13 Replies)
Discussion started by: ranga27
13 Replies
Login or Register to Ask a Question