Sponsored Content
Top Forums Shell Programming and Scripting finding the files based on date.. Post 302521803 by ygemici on Thursday 12th of May 2011 10:01:01 AM
Old 05-12-2011
Code:
>maillog;mydir=/home/pmutv/test/ ; backupdir=/home/pmutv/backup
find $mydir -name "product.sh.$(date +%Y%m%d)*"|while read -r myfile ; do [ -s $myfile ] && echo "$myfile --> exits and not empty" >>maillog
cp $file $backupdir ; done ; mail -s "Files in $mydir" xxxx@yyyyy.com <maillog

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding files older than the current date and time and renaming and moving

Hi, I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies

2. Shell Programming and Scripting

Finding files for a date

Hi, I have a directory with files from past 2 years.I need to find all the files for a specific date . Due to certain reasons I could not use this command in my process find . -type f \( -newer /tmp/May-1-2007 -a ! -newer... (4 Replies)
Discussion started by: Raamc
4 Replies

3. UNIX for Dummies Questions & Answers

finding and moving files based on the last three numerical characters in the filename

Hi, I have a series of files (upwards of 500) the filename format is as follows CC10-1234P1999.WGS84.p190, all in one directory. Now the last three numeric characters, in this case 999, can be anything from 001 to 999. I need to move some of them to a seperate directory, the ones I need to... (5 Replies)
Discussion started by: roche.j.mike
5 Replies

4. Shell Programming and Scripting

Finding files before a certain date with predefined format

Guys, I have an input file such as below I would like to know how i would be able to find items created before 2011-10-01 Appreciate any expert advice. Thanks. (3 Replies)
Discussion started by: aismann
3 Replies

5. Shell Programming and Scripting

Finding/Grep on files with date and hour in the file name

Hi, I have a folder structure as follows, DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt -> 01 -> ABC_2012-01-03_01.txt -> 02 -> ABC_2012-01-03_02.txt ... -> 23 -> ABC_2012-01-03_02.txt -> 2012-01-02 -> 2012-01-03 So the dir DATA contains the above hierarchy, User input Start and... (6 Replies)
Discussion started by: mihirvora16
6 Replies

6. UNIX for Advanced & Expert Users

Finding/Grep on files with date and hour in the file name

Hi, I have a folder structure as follows, DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt -> 01 -> ABC_2012-01-03_01.txt -> 02 -> ABC_2012-01-03_02.txt ... -> 23 -> ABC_2012-01-03_02.txt -> 2012-01-02 ... (1 Reply)
Discussion started by: mihirvora16
1 Replies

7. Shell Programming and Scripting

Finding/replacing strings in some files based on a file

Hi, We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Discussion started by: Talkabout
9 Replies

8. Shell Programming and Scripting

Finding files and sorting by date (find | awk)

I am wanting to search a directory tree and return files that are older than a specified datetime. So far straight forward with find, now I want to sort in date order and format the output. So far I have this, but is not working and there is a problem with "." in the file and/or path names. ... (2 Replies)
Discussion started by: larry2311
2 Replies

9. Shell Programming and Scripting

Finding all files based on pattern

Hi All, I need to find all files in a directory which are containing specific pattern. Thing is that file name should not consider if pattern is only in commented area. all contents which are under /* */ are commented all lines which are starting with -- or if -- is a part of some sentence... (13 Replies)
Discussion started by: Lakshman_Gupta
13 Replies

10. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies
FILETRAQ(8)						      System Manager's Manual						       FILETRAQ(8)

NAME
filetraq - keep track of changes in config files. SYNOPSIS
filetraq --help filetraq [filelist] [backupdir] DESCRIPTION
This manual page documents briefly the filetraq command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. FileTraq is a shell script that reads a list of files to watch, runs diff against each file and its backup, and reports any discrepancies, along with keeping a dated backup of the original. It's designed to be run as a cron job. OPTIONS
This command has two possible invocations, one with one option: --help Show summary of options and the default values of the config file and the backup directory. and other with no options, a config file or a config file and the backupdir. The debian version has been modified to read the /etc/default/filetraq configuration file, that lets the administrator change the default values of the config file ( file ), the backup directory ( backupdir ), the diff options used to print the filetraq output ( diffopts , e.g. -p -C 1 or -u ) and the diff order ( difforder , either newold (FileTraq default) or oldnew (traditional Unix default)). SECURITY
FileTraq is not well tested or hardened. It runs as root, but all of its config files should only be accessible by root. No security holes are known at this time, but please be careful. BUGS
Right now, it doesn't take care of its backups very well. The dated backups will accumulate in the backups directory, bounded only by diskspace. It only handles text files, it isn't a Tripwire replacement for use with system binaries. FILES
/etc/filetraq.conf /etc/default/filetraq /var/lib/filetraq SEE ALSO
diff(1), cron(8). AUTHOR
Jeremy Weatherford <xidus@xidus.net> Homepage: http://filetraq.xidus.net/ This manual page was written by Sergio Talens-Oliag <sto@debian.org>, for the Debian GNU/Linux system (but may be used by others). June 2001 FILETRAQ(8)
All times are GMT -4. The time now is 02:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy