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

  Unix/Linux 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 08-16-2013
joeyg's Unix or Linux Image
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 23 March 2015, 1:20 PM EDT
Location: Within two miles of a Dunkin donuts.
Posts: 2,351
Thanks: 80
Thanked 159 Times in 146 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 Unix and Linux 08-16-2013
RavinderSingh13 RavinderSingh13 is offline
Registered User
 
Join Date: May 2013
Last Activity: 26 March 2015, 7:52 PM EDT
Location: Chennai
Posts: 1,164
Thanks: 282
Thanked 358 Times in 346 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 Unix and Linux 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 Unix and Linux 08-16-2013
RavinderSingh13 RavinderSingh13 is offline
Registered User
 
Join Date: May 2013
Last Activity: 26 March 2015, 7:52 PM EDT
Location: Chennai
Posts: 1,164
Thanks: 282
Thanked 358 Times in 346 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 Unix and Linux 08-16-2013
gacanepa gacanepa is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 9 October 2014, 9:12 AM EDT
Location: Villa Mercedes, San Luis, Argentina
Posts: 170
Thanks: 21
Thanked 25 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 09:57 PM.