how to check whether the given file is 5 weeks older than current date

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to check whether the given file is 5 weeks older than current date
# 1  
Old 10-29-2007
how to check whether the given file is 5 weeks older than current date


I need to check whether the given file is 5 weeks older than current date ??
Can anyone give me the script for this ??
# 2  
Old 10-29-2007
Please search in the forum Smilie

There are many other threads discussing the same.

man find - atime / mtime
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies

2. UNIX for Beginners Questions & Answers

Subscribers with Date 90 days older than current date

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt... (1 Reply)
Discussion started by: dia
1 Replies

3. Shell Programming and Scripting

List 2 weeks older file on specific directory

Ive been a vocal of FIND command even before. Command below doesnt really give me the file that is older than two weeks.. Is there a script that will list me the log files that i want like for this date December 10, 2014, it shud list me the date between November 26, 2014 and below. When i run... (6 Replies)
Discussion started by: kenshinhimura
6 Replies

4. Shell Programming and Scripting

Move log files with date and delete older than 3 weeks

I have written a script which generate one logfile on every sunday and thursday I want to move the older log files into /tmp directory befor generating new one so i used mv command like mv usr/sbin/appl/logfile.txt usr/sbin/appl/tmp 2) But when i move this file to /tmp it will... (1 Reply)
Discussion started by: Nakul_sh
1 Replies

5. Shell Programming and Scripting

[SOLVED] Pull lines older than N weeks

There is another post in the forums that is similar to what I am trying to do, however, the thread is closed. So, I am creating this new one to see if someone could help. I am trying to use the code Ahamed posted, and tweak it. With the info from the forum, I recreated the scenario the person... (8 Replies)
Discussion started by: karstenjhilton
8 Replies

6. Shell Programming and Scripting

Shell Script to compare files, check current date and count

Hello - I have written the following basic shell script to count files, compare files and look for a particular strings in a file. Problem 1: How do I define more than 1 file location? #!/bin/bash #this is a test script FILES=$(ls /home/student/bin/dir1, home/student/bin/dir2)... (0 Replies)
Discussion started by: DallasT
0 Replies

7. Shell Programming and Scripting

Delete the files older than 3 weeks in a particular directory.

Hi, Friends, I am writing a script to delete all the files which are there for more than 3 weeks. I have tried this : find /home/appl/backup -type f -mtime +21 -exec rm -f {} \; But i am not sure if it deletes only the files in specified directory or all the directorinies in the provieded... (3 Replies)
Discussion started by: rajsharma
3 Replies

8. Shell Programming and Scripting

How to check date variable according to the current date?

Hi folks, I need to write a script that should activate a process according to the current hour. The process should be activatet only if the hour is between midnight (00:00) and 07:00. How should I create the condition? Thanks in advance, Nir (2 Replies)
Discussion started by: nir_s
2 Replies

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

10. Solaris

check the current date file in directory

Hi, I am making a script which check the directory and if there is today date file, it is showing message file is there for today date . 1) filename is$timestamp example ; 2) On monday i have recieved two file in this directory with current... (2 Replies)
Discussion started by: pallvi
2 Replies
Login or Register to Ask a Question