Sponsored Content
Full Discussion: Problem with find ! -newer
Top Forums Shell Programming and Scripting Problem with find ! -newer Post 93435 by dbfree on Monday 19th of December 2005 12:06:08 PM
Old 12-19-2005
Problem with find ! -newer

Hi,

I would like to find if a file called test.log is older than 10 min.

So i wrote :

#!/usr/bin/ksh
FICLOG="/home/uuu/result_test.log"
FIC="/home/uuu/test.log"

touch -t `perl -e 'use POSIX qw(strftime); printf("%s\n",strftime("%m%d%H%M",localtime(time-3600*0.17)));'` /tmp/ref_time.check.$$

if find $FIC -type f ! -newer /tmp/ref_time.check.$$ >> /dev/null 2>&1
then
DATE=`date "+%y/%m/%d %H:%M:%S"`
echo "$DATE :Problem_on_test.log" >> $FICLOG
fi

The problem is that it finds the test.log file even if it isn't older than 10 mn.

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar --newer = tar --newer-mtime ?

Hi, I have the following question : As far as I know unix doesn't store file creation dates. Would that imply the following? tar -cvzf backup.tar --newer is equal to: tar -cvzf backup.tar --newer-mtime ? (1 Reply)
Discussion started by: jamesbond
1 Replies

2. UNIX for Dummies Questions & Answers

Find files newer than...

Is there a way to use the find command to locate files newer than a specific date? Thanks! --Alex (4 Replies)
Discussion started by: vertigo23
4 Replies

3. 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

4. Shell Programming and Scripting

Problems with find's -newer Flag

I am writing a script that looks in a reports directory, copies a specified script to a working folder, copies some data files into the working folder, runs the report, zips the new files, then uploads them. Right now to determine what files to zip (as I don't know how many report files there... (6 Replies)
Discussion started by: droppedonjapan
6 Replies

5. Shell Programming and Scripting

How to script to find the newer date in a text file?

Hi, I have a text file, foo.txt, it looks something like below. In the file there is a line that gives the date in the form of: Mon Jun 15 11:09:31 2008. I need to find which date is the newest and then store certain details of that list data to another file. So, in this sample text file, I... (6 Replies)
Discussion started by: boolean2222
6 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. Shell Programming and Scripting

how to find a file then overwrite with a newer version

This should be a simple script, but can't find one with google search. I just need to find the file that is in many directories, then overwrite that file with a newer version i.e. find file.jar then overwrite with /root/file.jar All I get in searches is substitute text with new test inside... (1 Reply)
Discussion started by: haircat
1 Replies

8. UNIX for Dummies Questions & Answers

Find files newer than x days

We had an arrant rsync run and started copying over new files from one system to another. Although this is what we will want to do at some point, for now, we want to maintain the system as it was a few days ago. I am looking for a script that will find files that are newer than x days. ... (5 Replies)
Discussion started by: Leyva62
5 Replies

9. Shell Programming and Scripting

find command not searching path when -newer specified

When this command is issued from a directory other than where the file is located it works fine: find /db2/D01/log_archive/ -name "S0002166.LOG" -type f /db2/D01/log_archive/db2d01/D01/NODE0000/C0000000/S0002166.LOG When I change -name to -newer, it doesn't work. Find only searches the current... (5 Replies)
Discussion started by: fletchdb2
5 Replies

10. Linux Benchmarks

Newer PC build.

Just decided to run the benchmark for the heck of it. -Version- Dist: Debian GNU/Linux 8.5 CPU/Speed: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz RAM: DDR4 DRAM 64 GB 3000 MHz CMK64GX4M4B3000C15 MB: Maximus VIII Ranger Bus: 8 sata, 1 M.2 Socket 3 Cache: L2=4 x 256KB, L3=8 MB shared... (1 Reply)
Discussion started by: bajanine
1 Replies
CVS2HTML(1)						       Debian user's manual						       CVS2HTML(1)

NAME
cvs2html - render a CVS commit log in HTML SYNOPSIS
cvs2html [-a[-b][-k]] [-n numdif] [-l/-L home] [-e] [-f] [-d MMM DD [YYYY]] [-D DD] [-i image]] [-h] [-v] [-w framewidth] [-s percentage] [-N maxchrono] [-rrev1:rev2] [-c|-C cfilename] -O | -o htmlname [-p cvspath] [-v verbosity] DESCRIPTION
The cvs2html script fetches the commit log for a CVS module and renders it in HTML. -a Generate additional fields and files containing differences between versions in an xdiff-like side by side manner. -b Use spaces as breakpoints to wrap the text, if -a is specified. This is used to stop the two columns from exceeding the total width. -c | -C filename Save a chronologically sorted list of all log entries in html format in filename. Use -C to reverse-sort the file. -d MMM DD [YYYY] Omit all log messages prior to the given date. The first three letters of the month should be used (eg Jun 5). The year is optional. -D DD Omit all log messages older than DD days. -e Print log messages in courier (non-proportional) font. -f Generate individual log files for each file when using -o. -h Show help -i image Make image the background image. -k Ignore changes in lines caused by CVS-keyword substitutions when -a is specified. -l home Make links relative to home. -L home Make links relative to home, but substitute file extensions with .html. -n numdiff Output only the latest numdiff diffs in the log. Older commits will only have the log data displayed. -N maxchrono Show only the latest maxchrono file changes in the chronological list of changes. -o output If output is a directory, all html files produced are stored there, using the name of the repository as the base filename. Other- wise, output is used as the base name. Generate frames for easier browsing. -O output If output is a directory, all html files produced are stored there, using the name of the repository as the base filename. Other- wise, output is used as the base name. -P cvspath Set the cvs path to cvspath. -rrev1:rev2 Show only the log messages between rev1, and rev2. If a file isn't tagged, then the whole revision story of the file is shown. -s percentage Make the width of the left frame, percentage of the window. -v Insert CVSROOT information in the index. -V verbosity Set the verbosity. The higher verbosity is, the more output is printed out. -w framewidth Make the width of the left frame, framewidth pixels. EXAMPLE
cvs2html -l http://cvs.sslug.dk/linuxbog -f -p \ -o cvs2html/index.html -v -a -b -n 6 -C chrono.html Will create a directory called cvs2html directory. This directory will contain a log data file, for every file in the repository. The last 6 commits to every file will have a diff available. All links will be relative to http://cvs.sslug.dk/linuxbog. It will also create a file with all the log data in it, in chronological order. AUTHORS
The cvs2html script was written by Peter Toft and others (see the comments in /usr/bin/cvs2html for an exhaustive list). This manual page was written by Antti-Juhani Kaijanaho for Debian GNU, and modified by Pascal Hakim. SEE ALSO
The file /usr/share/doc/cvs2html/help.txt. The source code to cvs2html, in /usr/bin/cvs2html. cvs(1) Debian Project 1999-12-10 CVS2HTML(1)
All times are GMT -4. The time now is 10:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy