Sponsored Content
Top Forums Shell Programming and Scripting Check file creation Time minutes and if file older then 5 minutes execute some stuff Post 303031071 by jim mcnamara on Thursday 21st of February 2019 08:17:25 AM
Old 02-21-2019
Code:
export filename=/path/to/file/filename
tdiff=$(( `date +%s` - `stat -c %Y $filename` ))   # time in seconds of "now" minus the file mod time in seconds
if  [ $tdiff -ge 300 ] ';   then  
  # 300 seconds = five minutes, change to 360 or another number to suit your idea of 'five minutes old' in seconds
  echo "oops $filename is older than five minutes"

fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

files older than 15 minutes

Hi Friends, i have to write a script to raise a flag if there are any files that are older than 15 minutes in the directory.The directory is supplied as the parameter to the script. please help with a sample script. Thanks in advance veera (0 Replies)
Discussion started by: sveera
0 Replies

2. Shell Programming and Scripting

How can I create a file with current time - 60 minutes

I'm using k-shell in unix and I want to create a file with the current system time - 60 minutes. I know I can use touch to create the file, but I'm having trouble specifying how tell it to use the current time less 60 minutes. Any ideas??? (4 Replies)
Discussion started by: DaveyTN
4 Replies

3. Shell Programming and Scripting

only find files older than x minutes old

I am looking for a way to show files that have been created within a certain period (say anything older than 10 minutes or so). Is there a command/series of commands I can do this with? As an example, I have the following in a directory: -rw-r--r-- 1 owner group 70175 May 16 09:10... (1 Reply)
Discussion started by: dsimpg1
1 Replies

4. Shell Programming and Scripting

save weather radar to local time-named file every 15 minutes

I think I can do this myself now, but I am always amazed by how people can do things cleaner and simpler than I end up doing... Using cron, I want to save the image found at: http://radar.weather.gov/ridge/Conus/RadarImg/centgrtlakes.gif every 15 minutes to a local file , such as ... (1 Reply)
Discussion started by: brucewestfall
1 Replies

5. UNIX for Advanced & Expert Users

files older than 10 minutes

Hi, I have to find the files older than 10 minutes and remove those files as well as redirect the file names into a log file. i am using sun OS and my unix is not GNU and also not having perl. Could any one suggest me the way to approach. It would be great if script is provided. Also... (8 Replies)
Discussion started by: rohan10k
8 Replies

6. Shell Programming and Scripting

Check how many minutes ago the last file created

Hi , I need help in getting how many minutes ago the last file, matching some pattern in file name, was created in a folder. Thanks in advance. (8 Replies)
Discussion started by: Anupam_Halder
8 Replies

7. Shell Programming and Scripting

How to send a file in UNIX through email which is created only 15 minutes before the current time?

I wanted to send an email to the client whenever there is failed record created in a /feed/HR-76/failed folder after processing of feed file. I can find out with the help of below script that what is the new file created but that file didn't make just 15 minutes before. ... (1 Reply)
Discussion started by: puneetkhullar
1 Replies

8. UNIX for Beginners Questions & Answers

How to convert days hours minutes seconds to minutes?

Hi, please help with below time conversion to minutes. one column values: 2 minutes 16 seconds 420 msec 43 seconds 750 msec 0 days 3 hours 29 minutes 58 seconds 480 msec 11 seconds 150 msec I need output in minutes(total elapsed time in minutes) (2 Replies)
Discussion started by: ramu.badugula
2 Replies

9. Shell Programming and Scripting

Grep a log file for the last 5 minutes of contents every 5 minutes

Hi all, System Ubuntu 16.04.3 LTS i have the following log INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042 INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies

10. UNIX for Beginners Questions & Answers

Find if create time of last created file in a directory is older than 5 minutes

A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes? OS is AIX (3 Replies)
Discussion started by: malaika
3 Replies
install-datebook(1)					      General Commands Manual					       install-datebook(1)

NAME
install-datebook - installs a new datebook entries onto your Palm handheld device SYNOPSIS
For serial devices, the -p <port> option is required, or you may use the $PILOTPORT environment variable: install-datebook -p /dev/ttySX filename [filename filename ...] For USB devices, the new USB port specification is: install-datebook -p usb:/dev/ttyUSBX filename [filename filename ...] DESCRIPTION
install-datebook allows the user to write one or more datebook entries from one or more source files. Once install-datebook is started, the user must invoke HotSync on the target device by pressing the HotSync button on the cradle or by tapping on the HotSync icon in the Palm launcher. The format of the source file contains one datebook entry on line, containing four tab separated fields. The fields are start date/time, end date/time, alarm settings, and the description of datebook entry. This program doesn't yet support repeted entries. The date and time must be in format understand by parsedate.y. At the very least, the following two formats are understood: August 11, 1997 0800 GMT+300 1997/08/11 08:22:33 GMT+300 If either one of the date and time fields is empty, the entry is installed without time. If the alarm field is empty, the entry is installed without setting any alarms. The alarm field can contain numbers followed by "m" (minutes), "h" (hours), or "d" (days). Here are some example lines ("<TAB>" = tab, "<NL>" = newline in these examples): -> 1997/08/11 0800 GMT+300 <TAB> 1997/08/11 0900 GMT+300 <TAB> <TAB> IETF Registration <NL> -> August 11, 1997 0900 GMT+300 <TAB> August 11, 1997 0930 GMT+300 <TAB> 2m <TAB> Introductions <NL> OPTIONS none USAGE
The program will connect to the target Palm device, and write the datebook-formatted file given on the command line onto the Palm into the DatebookDB.pdb file. KNOWN BUGS
If no timezone is given, install-datebook will assume the time is in GMT and it will convert it to localtime. If you don't want to write timezone entries to all begin and end times, set the TZ environment variable to GMT before running this program. REPORTING BUGS
Report bugs at http://bugs.pilot-link.org/ AUTHOR
install-datebook was written by Tero Kivinen <kivinen@iki.fi>. This program was based on install-todos program written by Robert A. Kaplan <kaplan@openmarket.com>. SEE ALSO
Free Software Foundation Palm Computing Device Tools install-datebook(1)
All times are GMT -4. The time now is 05:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy