Sponsored Content
Top Forums Shell Programming and Scripting File Timestamp and date comparsion Post 302661889 by Chubler_XL on Monday 25th of June 2012 11:38:03 PM
Old 06-26-2012
Code:
$ echo "Jun 25 09:10 new_file24062012111590.txt" | awk '{gsub(/\.[^.]*$/,"",$0); L=length;
     D=substr($0,L-9,4) substr($0,L-11,2) substr($0,L-13,2);
     if(0+D>M)M=D} END {print M}'
20120624

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating file with date/timestamp in it

I need to create a file through a c-shell script which contains only the date and time that the file was created. Does anyone know a simple way to do this? Thank you, Paula (7 Replies)
Discussion started by: ccpjr29
7 Replies

2. UNIX for Dummies Questions & Answers

get a file date/timestamp

Could someone tell me how to get the date/time (to the second) a file was last modified? I need to know if a file was modified in the last 30 seconds from the system date. I'm on AIX/unix 4.3 (3 Replies)
Discussion started by: alex31
3 Replies

3. Shell Programming and Scripting

File renaming with date timestamp

Hi, This is my script: #! /usr/bin/ksh cd /app/chdata/workflow/suppl/esoutput/spd/testing for file in /app/chdata/workflow/suppl/esoutput/spd/testing do sort *.txt | awk '{ file=substr($0,1,2)".txt"; print >> file }' ... (3 Replies)
Discussion started by: Sunitha_edi82
3 Replies

4. AIX

how to grep and compare timestamp in a file with the current date

I want to read a log file from a particular location.In the logfile , lines contains timestamp.I need to compare the timestamp in the logfile with the current date.If the timpestamp in the log file is less than 4 hours then i need to read the file from that location.Below is the file format.Please... (1 Reply)
Discussion started by: achu
1 Replies

5. AIX

how to grep and compare timestamp in a file with the current date

I want to read a log file from a particular location.In the log file each line starts with timestamp.I need to compare the timestamp in the logfile with the current date.If the timpestamp in the log file is less than 4 hours then i need to read the file from that location.Below is the file... (1 Reply)
Discussion started by: achu
1 Replies

6. Shell Programming and Scripting

To get max/min Date/Timestamp from a file

I want to get maximum/minimum date/timestamp from a data file ? Sample Input File ============= rec#,order_dt,ext_ts 1,2010-12-01,2010-12-01 17:55:23.222222 2,2011-11-05,2010-12-01 19:55:23.222222 3,2009-10-01,2010-12-01 18:55:23.222222 for above file Maximum Order_dt = 2011-11-05... (5 Replies)
Discussion started by: vikanna
5 Replies

7. Shell Programming and Scripting

Check if a date field has date or timestamp or date&timestamp

Hi, In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date&timestamp. I have to figure out the the data is a date or time stamp or date&timestamp. If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies

8. UNIX for Dummies Questions & Answers

Help me in the Execution of Date comparsion

Hi , Please look into the query 1)Date format: mm/dd/yyyy  example (10/22/2013) 2) compare this date  with the System date  3) if the difference of dates less than 30 days. Then return true otherwise false. 4)commands date-d is not there in my unix version. 5)present version 6 6)using... (7 Replies)
Discussion started by: RaghavendraT
7 Replies

9. Shell Programming and Scripting

Replacing Date in the file with Create date and timestamp

Hello, I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name. imap-hp-import-20150917.txt imap-dell-gec-import-20150901.txt imap-cvs-import-20150915.txt imap-gec-import.txt... (8 Replies)
Discussion started by: Saanvi1
8 Replies

10. UNIX for Advanced & Expert Users

File comparsion tool

Hi All, Please suggest some file comparison tool in Linux. The tool have the provision for command line option for file comparison and the output will be stored in to html file. Thanks in advance (2 Replies)
Discussion started by: k_manimuthu
2 Replies
Scheduler Implementation API(3) 			 globus scheduler event generator			   Scheduler Implementation API(3)

NAME
Scheduler Implementation API - Enumerations enum globus_scheduler_event_generator_error_t { GLOBUS_SEG_ERROR_TYPE_NULL = 1024, GLOBUS_SEG_ERROR_TYPE_ALREADY_SET, GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE, GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT, GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY, GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE } Functions globus_result_t globus_scheduler_event (const char *format,...) globus_result_t globus_scheduler_event_pending (time_t timestamp, const char *jobid) globus_result_t globus_scheduler_event_active (time_t timestamp, const char *jobid) globus_result_t globus_scheduler_event_failed (time_t timestamp, const char *jobid, int failure_code) globus_result_t globus_scheduler_event_done (time_t timestamp, const char *jobid, int exit_code) globus_result_t globus_scheduler_event_generator_get_timestamp (time_t *timestamp) Detailed Description Scheduler-specific SEG module implementations use this API to issue events to the Job State Monitor. Events occur whenever a job is placed in the scheduler's queue (PENDING), begins execution (ACTIVE), terminates successfully (DONE), or ends abnormally (FAILED). A SEG module should register an event with the Globus event driver (most likely using either the Globus Callback or Globus XIO interfaces) in its activation function and then return. All events should be triggered from callbacks. When the SEG detects that it should terminate, it will deactivate the SEG module it started. The SEG module should wait for any outstanding callbacks to subside and before returning from its deactivation function to ensure that all events will be properly dispatched. After deactivation is complete, the SEG will unload the shared module and terminate. Enumeration Type Documentation enum globus_scheduler_event_generator_error_t Error types used by the SEG. Enumerator: GLOBUS_SEG_ERROR_TYPE_NULL NULL Parameter. GLOBUS_SEG_ERROR_TYPE_ALREADY_SET Already called a one-time function. GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE Shared module missing descriptor. GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT Invalid printf format for SEG protocol message. GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY Out of memory. GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE Unable to load scheduler module. Function Documentation globus_result_t globus_scheduler_event (const char *format, ...) Send an arbitrary SEG notification. Parameters: format Printf-style format of the SEG notification message ... Varargs which will be interpreted as per format. Return values: GLOBUS_SUCCESS Scheduler message sent or queued. GLOBUS_SEG_ERROR_NULL Null format. GLOBUS_SEG_ERROR_INVALID_FORMAT Unable to determine length of formatted string. globus_result_t globus_scheduler_event_pending (time_ttimestamp, const char *jobid) Send a job pending event to the JobSchedulerMonitor implementation. Parameters: timestamp Timestamp to use for the event. If set to 0, the time which this function was called is used. jobid String indicating the scheduler-specific name of the job. Return values: GLOBUS_SUCCESS Scheduler message sent or queued. GLOBUS_SEG_ERROR_NULL Null jobid. GLOBUS_SEG_ERROR_INVALID_FORMAT Unable to determine length of formatted string. globus_result_t globus_scheduler_event_active (time_ttimestamp, const char *jobid) Send a job active event to the JobSchedulerMonitor implementation. Parameters: timestamp Timestamp to use for the event. If set to 0, the time which this function was called is used. jobid String indicating the scheduler-specific name of the job. Return values: GLOBUS_SUCCESS Scheduler message sent or queued. GLOBUS_SEG_ERROR_NULL Null jobid. GLOBUS_SEG_ERROR_INVALID_FORMAT Unable to determine length of formatted string. globus_result_t globus_scheduler_event_failed (time_ttimestamp, const char *jobid, intfailure_code) Send a job failed event to the JobSchedulerMonitor implementation. Parameters: timestamp Timestamp to use for the event. If set to 0, the time which this function was called is used. jobid String indicating the scheduler-specific name of the job. failure_code Failure code of the process if known. Return values: GLOBUS_SUCCESS Scheduler message sent or queued. GLOBUS_SEG_ERROR_NULL Null jobid. GLOBUS_SEG_ERROR_INVALID_FORMAT Unable to determine length of formatted string. globus_result_t globus_scheduler_event_done (time_ttimestamp, const char *jobid, intexit_code) Send a job done event to the JobSchedulerMonitor implementation. Parameters: timestamp Timestamp to use for the event. If set to 0, the time which this function was called is used. jobid String indicating the scheduler-specific name of the job. exit_code Exit code of the process if known. Return values: GLOBUS_SUCCESS Scheduler message sent or queued. GLOBUS_SEG_ERROR_NULL Null jobid. GLOBUS_SEG_ERROR_INVALID_FORMAT Unable to determine length of formatted string. globus_result_t globus_scheduler_event_generator_get_timestamp (time_t *timestamp) Get the timestamp for the earliest event an SEG module should send. Parameters: timestamp Pointer to a time_t which will be set to the timestamp passed to the SEG executable. The module should not send any events which occur prior to this timestamp. Return values: GLOBUS_SEG_ERROR_NULL Null timestamp. GLOBUS_SUCCESS Timestamp value updated. If the timestamp was not set on the SEG command-line, then the value pointed to by timestamp will be set to 0. Author Generated automatically by Doxygen for globus scheduler event generator from the source code. Version 4.6 Mon Apr 30 2012 Scheduler Implementation API(3)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy