Find big file include current date


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find big file include current date
# 1  
Old 05-19-2014
Linux Find big file include current date

Hi,

I want to put script. The script is to show file that larger than 100MB include current date (eg: today date).

After find the date, it will compress list file and split the tar.gz file. Any idea how to do that?

This bash script will run auto everyday. It's will transfer will to other server. Please assist me.

Thanks.
# 2  
Old 05-19-2014
What have you tried so far?
# 3  
Old 05-19-2014
Using this command:
Code:
RESULT=`du -sm /mnt/* | awk '{ if ($1 > 100)print $2 }'`

But that show only big file. I want to include a date. Today date. When it's run tomorrow, it will put tomorrow date.

Last edited by Franklin52; 05-21-2014 at 09:37 AM.. Reason: Please use code tags
# 4  
Old 05-20-2014
There is a command named date that can help you with that.

e.g.
date "+%F" would display YYYY-MM-DD
It has many other possibilities.

There is also a command named find that might be helpful to find those large files

e.g.
Code:
find /mnt/ -type f -size +10M

That would traverse the /mnt directory and would pick files larger than 10M
It has many other possibilities.
# 5  
Old 05-20-2014
Do i need to put like this:
Code:
`du -sm /mnt/* | awk '{ if ($1 > 100)print $2 }' date "+%F"`


Last edited by Franklin52; 05-21-2014 at 09:37 AM.. Reason: Please use code tags
# 6  
Old 05-20-2014
I am afraid that would not make any sense.

Where would you like the date to be? Can you show an example of what you are trying to do?
du -sm /mnt/* | awk '{if ($1 > 100) print $2) }' will produce a column list.
# 7  
Old 05-20-2014
I want to pick date. The current date. As previous i already explain.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replace date in file every day with current date

I Have text like XXX_20190908.csv.gz need to replace Only date in this format with current date every day Thanks! (1 Reply)
Discussion started by: yamasani1991
1 Replies

2. UNIX for Beginners Questions & Answers

“sed” replace date in text file with current date

We want to call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ Code: line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to write a... (3 Replies)
Discussion started by: pradeepp
3 Replies

3. Shell Programming and Scripting

Find the file created on current date

Hi All, I'm trying to find a file which is created on current day.... I searched in unix.com and i found, below command. find /land/ -mtime -1 -type f -print | grep "FF_Member_STG.dat" The command checks if the file with name "FF_Member_STG.dat" is created today then exit else proceed. ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

4. Shell Programming and Scripting

Get file name which include the current date

Hi, I'm trying to get the name of a file that has the current date in the name. The filename is on the form A<current date>01.DC, for example A2012110501.DC I have this script so far date +%y%m%d D=$(date +%y%m%d) N=A20$D echo $N N2={$N}01.DC echo $N2 And gets the following... (12 Replies)
Discussion started by: Immelstorn
12 Replies

5. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

6. UNIX for Advanced & Expert Users

In ksh find out the timestamp of current date?

Normally we can use %s to find out the time in second since 1970. But in my ksh, this format option is not available. Example- date +%s 1268103151 above script command won't work in ksh. Can you guys provide its equivalent ? (3 Replies)
Discussion started by: boy18nj
3 Replies

7. Shell Programming and Scripting

How to find the create time of a file if current date is in next month

Hi All, I want to find the time diffrence between currnt time and "abc.txt" file create time. I have solve that but if the abc.txt file created last month then is there any process to find the difftent? Exp: Create time of abc.txt is "Apr 14 06:48" and currect date is "May 17 23:47".... (1 Reply)
Discussion started by: priyankak
1 Replies

8. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

9. Shell Programming and Scripting

Perl: Extracting date from file name and comparing with current date

I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date. $file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies

10. UNIX for Dummies Questions & Answers

how to find files less than the current date

Hai, i have one directory contains 100 files .each file name like xvb_dateformat.i want find which file names are xvb_lessthan or equal to currentdate. any one give the solution. regards (4 Replies)
Discussion started by: mallikarjuna
4 Replies
Login or Register to Ask a Question