I wrote this script to find files older than time parameter, count the number of files, and send an email to me that some files are in a particular folder. For the particular path, the script should wait delay parameter before running again.
For example, assuming the input file looks like this
20 A/B/ 5m
10 C/D 4m
The script changes dir to A/B, finds all files older than 20mins,counts them and sends an email to me.It then waits 5minutes before running again.It, however,keeps running to process the second path (C/D). It only waits if it found files older than the time parameter, otherwise it does nothing.It waits only for the path if found files, otherwise it keeps processing other paths.
I wrote something like this but doesnt seem to work
Hello,
I wanted to send mail to multiple receiptant by using uuencode with find command.
I have used the below find command to search a file, which generating daily at the particular time. .
find . -type f -mtime -1 -printf '%f %TH:%TM\n' | awk '$NF>"06:40" && $NF<"06:50" {print $1}'
I... (2 Replies)
Need to write a shell script on AIX box which will connect to different servers using SFTP and get the file count of only 1 day older files. (purging list)
How to achieve this?
On local server we can use:
find <path> -type f -mtime +1
But how to do it in case of SFTP? Please advise. Thanks... (9 Replies)
All,
I am new to shell scripting and trying to get the count of files that starts with error and with extension .out, if the count is greater than 0 and zip the file and send an email with the content of error.out file, here is my script
cd /temp
testcount =$('find . -name '*.out' -print |... (4 Replies)
Hi Gurus
the count of files in a particular Directory...
ls -lrth | grep -c ^-
can any one share the command to Count the files which is Older than 3 months
So please help me out in this
Thanks in Advance (2 Replies)
Hello,
I have a script which finds files in a directory that are older than 30 days and remove them.
The problem is that these files are too many and when i run this command:
find * -mtime +30 | xargs rm
I run this command inside the directory and it returns the error:
/usr/bin/find:... (8 Replies)
I'm tring to:
find files recursively older than x days that contain dat or DAT then tar them
I can find the files older than 90 days containing dat with this:
find . -mtime +90 -type f -name "*dat*" -exec tar -cvvfp /some/path/some.tar {} \;
but how do I do it case insensitive?
... (3 Replies)
What command arguments I can use in unix to list files older than 10 days in my current directory, but I don't want to list the hidden files.
find . -type f -mtime +15 -print will work but, it is listing all the hidden files., which I don't want. (4 Replies)
Dear Friends,
I have two queries.
1) I want to see the list of folders which were created 29 days ago.
2) I want to see the folders in which last created file is older than 29 days.
Can it be done?
Thank you in advance
Anushree (4 Replies)
I need a shell script which checks for a file in a particuler folder and should send me a mail if the file of that name is present.
Please help me on this.I am new to shell scripting. (6 Replies)
I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in.
How can this be done?? Find returns files that I do not want. (2 Replies)