The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-04-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Trexlim,
A true date calculation can be very involved as you have to consider leap years.
One way to solve your problem is:
1) One time only, create a "15_minutes_file".
2) Create a cron job that runs every 15 minutes.
2.a) Test if the file is older than 15_minutes_file -- "if file -ot 15_minutes_file"
2.a.I) Meets your criteria.
2.b) Update (touch) the "15_minutes_file" file with the current date.
See if this works for you.
Reply With Quote