How to find a file created in UNIX every monday.??? | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

How to find a file created in UNIX every monday.???

HP-UX


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-16-2013
k_s_rao7 k_s_rao7 is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 16 August 2013, 7:58 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
How to find a file created in UNIX every monday.???

Hi All

Any one please suggest me...

I have one directory every monday one file will be created in that directory. so if the file is created on monday or not i need check first.
How can write a script??? if the file is not created i want to quit from script.


Thanks
K.Srinivas

Last edited by joeyg; 08-16-2013 at 07:38 AM..
Sponsored Links
    #2  
Old 08-16-2013
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 29 September 2014, 2:25 PM EDT
Location: Out running a Marathon.
Posts: 2,332
Thanks: 73
Thanked 155 Times in 144 Posts
What have you tried?

While we recognize users have all different abilities, you have not supplied anything as far as what you have tried nor any specifics.
Sponsored Links
    #3  
Old 08-16-2013
RavinderSingh13 RavinderSingh13 is offline
Registered User
 
Join Date: May 2013
Last Activity: 1 October 2014, 2:37 PM EDT
Location: Chennai
Posts: 682
Thanks: 193
Thanked 137 Times in 134 Posts
Hello,

Could you please use the following code and let me know. It will shopw that file is exist or not.

Note: Where file


Code:
$ cat script.ksh
file="filename"
if [[ -e ${file} ]]
then
echo "file is present there."
else
echo "not present"
 fi


Please run the file as follows.

Code:
ksh script.ksh

Output will be as follows.



Code:
file is present there.



Thanks,
R. Singh
    #4  
Old 08-16-2013
k_s_rao7 k_s_rao7 is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 16 August 2013, 7:58 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your Reply

just i want to check the file is created on monday or not..?
Sponsored Links
    #5  
Old 08-16-2013
RavinderSingh13 RavinderSingh13 is offline
Registered User
 
Join Date: May 2013
Last Activity: 1 October 2014, 2:37 PM EDT
Location: Chennai
Posts: 682
Thanks: 193
Thanked 137 Times in 134 Posts
Hello,

please use the crontab facility for the same you can shedule the script to run on every Monday for same.


Hope this will help you.


Thanks,
R. Singh
Sponsored Links
    #6  
Old 08-16-2013
gacanepa gacanepa is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 24 September 2014, 12:33 PM EDT
Location: Villa Mercedes, San Luis, Argentina
Posts: 170
Thanks: 21
Thanked 24 Times in 21 Posts
Quote:
Originally Posted by k_s_rao7 View Post
Thanks for your Reply

just i want to check the file is created on monday or not..?
Do you mean last monday or just any Monday?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to find out when a file was created? rahmantanko UNIX for Dummies Questions & Answers 3 11-20-2012 05:59 PM
Find first created file date in YYYYMMDD format Raamc Shell Programming and Scripting 3 11-06-2010 01:50 AM
Find unix file created how many days ago? utoptas Shell Programming and Scripting 4 07-27-2010 04:24 PM
Need to find created date of file in UNIX amirthraj_12 Shell Programming and Scripting 7 07-07-2006 02:44 AM
I want to get the file which created the error when the find command was run guhas Shell Programming and Scripting 1 10-21-2005 03:06 PM



All times are GMT -4. The time now is 04:18 PM.