Check the Usability of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Check the Usability of files
# 8  
Old 10-08-2008
Lol, is this hairsplitting? Do you know all finds that exist in the world? Sure, it is obvious that all should have -atime, but how can we really know?!. Smilie Smilie

-atime is a switch, what it follows I'd call an operand or parameter. Never heared it different nor read it in a book.
# 9  
Old 10-08-2008
Can someone please provide the solution with the find command
# 10  
Old 10-08-2008
ok.. this is one method..

First evaluate the number of days between the days using the script below..

Code:
D1=`date +%s -d "2007-12-19"`
D2=`date +%s -d "2008-02-09"`
((diff_sec=D2-D1))
echo - | awk -v SECS=$diff_sec '{printf "Number of days : %d",SECS/(60*60*24)}'

Then fire the following command...

Code:
find . -atime $Diff

where $Diff is the variable which contains diffrence between two dates

hope this helps.. Tweak the script as per your need...
# 11  
Old 10-08-2008
it is giving me this error while running

date: 0551-402 Invalid character in date/time specification.
Usage: date [-u] [+"Field Descriptors"]
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Google Search Console - Mobile Usability - No Errors or Issues - New Milestone

For the first time in the history of the site Google Search Console (GSC) has unix.com showing "no mobile viewability errors". This is no small achievement considering the hundreds of thousand of lines of legacy code we run at a site which has been around much longer than Facebook or LinkedIn: ... (0 Replies)
Discussion started by: Neo
0 Replies

2. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies

3. Shell Programming and Scripting

Check files and archive the files using sftp

Hi, I have to check the files in another server using sftp to do that, below is the code i am going with #!/bin/bash export SRC_FOLDER=$1 export ARC_FOLDER=$2 HOST=as07u3456 USER=relfag sftp ${USER}@${HOST} <<EOF cd $SRC_FOLDER/DSCOR ls bye EOF echo "done" whatever the files i... (8 Replies)
Discussion started by: ursrami
8 Replies

4. Shell Programming and Scripting

Kindly check it: Camparison of files only column1 of 2 files

Hi all, I have 2 files in which i have to find commom entries in column 1 an dif soemthing is common write other data of both files in front of it mentioned. Gene symbol and disease name column 1 column2 ARFGEF2 CAD DDEF2 CAD PSCD3 CAD PSCD4 CAD CAMK1... (15 Replies)
Discussion started by: manigrover
15 Replies

5. Shell Programming and Scripting

Perl code to check date and check files in particular dir

Hi Experts, I am checking how to get day in Perl. If it is “Monday” I need to process…below is the pseudo code. Can you please prove the code for below condition. if (today=="Monday" ) { while (current_time LESS THAN 9:01 AM) ... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

6. Shell Programming and Scripting

need a shell script to extract the files from source file and check whether those files existonserve

Hi, I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is # echo $0 -sh My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Discussion started by: muraliinfy04
13 Replies

7. Shell Programming and Scripting

how to check files

Hi, I have a dir in which I need to check for 3 files. and naming for three files are as below. fileone_yyyy_mm_dd.dat filetwo_yyyy_mm_dd.dat filethree_yyyy_mm_dd.datand YYYY_mm_dd will change everyday as the date changes. I need to check everyday all these files are existing or not... (4 Replies)
Discussion started by: ravinunna
4 Replies

8. Shell Programming and Scripting

How to check files and move the results to differents files?

Hi, I am a newbie to shell scripting. here is my objective: 1)The shell program should take 2 parameters - ie-> DestinationFolder, WebFolder 2)Destination folder contains few files that has to has be verified and deleted. 3)WebFolder is a folder containing a list of master files 4)It... (1 Reply)
Discussion started by: sandhyagupta
1 Replies

9. Shell Programming and Scripting

Check 2 files ???

Hi all, I know how to count lines, count byte of a file, but really dont know how to compare line , I am newbie and hope you can help me to learn more about UNIX. Here is my problem. ==== How : 1. File A (Flatfile with NAME|DATE|ID1|ID2|ID3|ID4|ID5)... (3 Replies)
Discussion started by: sabercats
3 Replies
Login or Register to Ask a Question