Sponsored Content
Full Discussion: last run time of any script
Top Forums Shell Programming and Scripting last run time of any script Post 302247518 by jim mcnamara on Wednesday 15th of October 2008 09:17:01 PM
Old 10-15-2008
Code:
ls -lu filename.sh

This gives the last time the file was accessed - it is not an absolute guarantee this is the last time it was run.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Preventing script to run at the same time.

I have a script, myscript.pl I want to set the script to exit if it is already running. At the moment I am using soft stop. eg: if -e dummy file then exit else create a dummy file Is there any other better way to perform this? Maybe ps -ef | egrep 'myscript.pl' (3 Replies)
Discussion started by: cronboss
3 Replies

2. UNIX for Advanced & Expert Users

run script in autosys at a specified time.

I have created a shell script. I want to run the script in Autosys. Please note my shell script runs as "$ ksh run.ksh" How do I make autosys run this script at 5:00PM every day? insert_job: abc job_type: c box_name: run.box command: ksh run.ksh machine: mach1 #owner: mach1@mymach... (1 Reply)
Discussion started by: gram77
1 Replies

3. Shell Programming and Scripting

Run script at same time

Hi My five script run throgh crontab at same time at 6 clock. Due to problem in the data load .Now I want to check time of load finish run these jobs. I create a script which check the load finish time but I have no idea how I run these JObs. This is very urget to me. Please reply me as soon... (3 Replies)
Discussion started by: Jamil Qadir
3 Replies

4. Shell Programming and Scripting

run script for given time

Hi! I need to run my script for a specific number of time, as specified by the user: For instance, if the user specified 10, my script should run for until 10 seconds expire. How do I do this? (0 Replies)
Discussion started by: looza
0 Replies

5. Shell Programming and Scripting

How to find the time taken for a script to run?

I have just written a Csh script and i want to find out how long does the script take to complete executing. Is there any codes which i can put into my script to capture its run time ? (9 Replies)
Discussion started by: Raynon
9 Replies

6. UNIX for Dummies Questions & Answers

Run script in the background with a time interval

I have a script I want to run in the background, and I have looked it up but I am not exactly sure how to do. First of all to run it in the background do you have to put something in the script or is it just a command when you go to run it. I found this solution to it but once again I am not to... (2 Replies)
Discussion started by: mauler123
2 Replies

7. Shell Programming and Scripting

Time taken to run a SQL script

Hello I am asked to run around 5-6 SQL queries in a shell script and take a note of the time taken to execute each query to a file. How do I get the time taken to run the individual SQL queries (2 Replies)
Discussion started by: vat1kor
2 Replies

8. Shell Programming and Scripting

Run a task in a script at a particular time

I have an ETL process that triggers a shell script. This script picks the files created by the ETL process and does an SFTP. These are huge files. Due to infrastructure limitations, we need to trigger the actual SFTP part only during the 2nd, 16th, 31st and 46th minute of an hour. Please let me... (2 Replies)
Discussion started by: vskr72
2 Replies

9. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

10. UNIX for Beginners Questions & Answers

Shell Script to run in given time

Hi All, Would like to write a Script which will run between 11am to 3 pm and send the results to output.txt. Please suggest. (2 Replies)
Discussion started by: vasuvv
2 Replies
Test::MockTime(3pm)					User Contributed Perl Documentation				       Test::MockTime(3pm)

NAME
Test::MockTime - Replaces actual time with simulated time SYNOPSIS
use Test::MockTime qw( :all ); set_relative_time(-600); # do some tests depending on time increasing from 600 seconds ago set_absolute_time(0); # do some more tests depending on time starting from the epoch # epoch may vary according to platform. see perlport. set_fixed_time(CORE::time()); # do some more tests depending on time staying at the current actual time set_absolute_time('1970-01-01T00:00:00Z'); # do some tests depending on time starting at Unix epoch time set_fixed_time('01/01/1970 00:00:00', '%m/%d/%Y %H:%M:%S'); # do some tests depending on time staying at the Unix epoch time restore_time(); # resume normal service DESCRIPTION
This module was created to enable test suites to test code at specific points in time. Specifically it overrides localtime, gmtime and time at compile time and then relies on the user supplying a mock time via set_relative_time, set_absolute_time or set_fixed_time to alter future calls to gmtime,time or localtime. Functions set_absolute_time If given a single, numeric argument, the argument is an absolute time (for example, if 0 is supplied, the absolute time will be the epoch), and calculates the offset to allow subsequent calls to time, gmtime and localtime to reflect this. for example, in the following code Time::Mock::set_absolute_time(0); my ($start) = time; sleep 2; my ($end) = time; The $end variable should contain 2 seconds past the epoch; If given two arguments, the first argument is taken to be an absolute time in some string format (for example, "01/01/1970 00:00:00"). The second argument is taken to be a "strptime" format string (for example, "%m/%d/%Y %H:%M:%S"). If a single argument is given, but that argument is not numeric, a "strptime" format string of "%Y-%m-%dT%H:%M:%SZ" is assumed. for example, in the following code Time::Mock::set_absolute_time('1970-01-01T00:00:00Z'); my ($start) = time; sleep 2; my ($end) = time; The $end variable should contain 2 seconds past the Unix epoch; set_relative_time($relative) takes as an argument an relative value from current time (for example, if -10 is supplied, current time be converted to actual machine time - 10 seconds) and calculates the offset to allow subsequent calls to time,gmtime and localtime to reflect this. for example, in the following code my ($start) = time; Time::Mock::set_relative_time(-600); sleep 600; my ($end) = time; The $end variable should contain either the same or very similar values to the $start variable. set_fixed_time If given a single, numeric argument, the argument is an absolute time (for example, if 0 is supplied, the absolute time will be the epoch). All subsequent calls to gmtime, localtime and time will return this value. for example, in the following code Time::Mock::set_fixed_time(time) my ($start) = time; sleep 3; my ($end) = time; the $end variable and the $start variable will contain the same results If given two arguments, the first argument is taken to be an absolute time in some string format (for example, "01/01/1970 00:00:00"). The second argument is taken to be a "strptime" format string (for example, "%m/%d/%Y %H:%M:%S"). If a single argument is given, but that argument is not numeric, a "strptime" format string of "%Y-%m-%dT%H:%M:%SZ" is assumed. restore() restore the default time handling values. "restore_time" is an alias. When exported with the 'all' tag, this subroutine is exported as "restore_time". AUTHOR
David Dick <ddick@cpan.org> PREREQUISITES
Time::Piece 1.08 or greater BUGS
Probably. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ACKNOWLEDGEMENTS
Thanks to a use.perl.org journal entry <http://use.perl.org/~geoff/journal/20660> by Geoffrey Young. perl v5.10.0 2008-06-29 Test::MockTime(3pm)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy