Sponsored Content
Full Discussion: Date Time Stamp
Top Forums Shell Programming and Scripting Date Time Stamp Post 79602 by Ygor on Thursday 28th of July 2005 09:28:05 PM
Old 07-28-2005
Time in seconds since a file was last modified...
Code:
perl -e '@q=stat($ARGV[0]); print time-$q[9]' file1

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File date and time stamp

I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second. Any ideas... (1 Reply)
Discussion started by: Xenon
1 Replies

2. Shell Programming and Scripting

Insert Time and Date Stamp

I have a directory with following files in it ABC.000.DAT ABC.001.DAT ABC.002.DAT ABC.003.DAT I want to insert time and date stamp in file names like ABC.000.YYYYMMDDHHMM.DAT I able to insert the time and date stamp at the end of filename Kindly help (1 Reply)
Discussion started by: aajmani
1 Replies

3. UNIX for Dummies Questions & Answers

Date/Time Stamp

Hi All, Wondering if there is have a date added at the end of a test string. I have a hypothetical text file day one: John Paul George When the file day one is output, I'd like it to read something like this: John 101406 Paul 101406 George 101406 Day two, when the same text file... (0 Replies)
Discussion started by: JimmyFlip
0 Replies

4. UNIX for Advanced & Expert Users

rsync - date/time stamp

Hi, We are using RSYNC for syncing remote directories and working great. Our requirement is to have the destination files with date/time stamp of when they're copied on to the destination server, NOT the date/time stamps of source files/directories. As RSYNC, by default, preserving the same... (4 Replies)
Discussion started by: prvnrk
4 Replies

5. Shell Programming and Scripting

append date time stamp via ftp script

I have searched several thread and not found my solution, so I am posting a new qustion. I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name. I need to FTP the files to the MS server, but... (1 Reply)
Discussion started by: sknisely
1 Replies

6. Shell Programming and Scripting

Set date and time stamp of one file to another

Hi I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file. Is there anyway to do it simple instead of manually taking date/stamp of first file? TIA Prvn (2 Replies)
Discussion started by: prvnrk
2 Replies

7. Shell Programming and Scripting

If(Condition) Rename a file with (Date+Time) Stamp

Hi! Please see our current script: #!/usr/bin/ksh if (egrep "This string is found in the log" /a01/bpm.log) then mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log fi To the above existing script, we need to add the following change: 1) After finding the string,... (7 Replies)
Discussion started by: atechcorp
7 Replies

8. Emergency UNIX and Linux Support

How to append date and time stamp before the two extensions?

hi, i have some file names. my file names are as follows: c_abc_new.txt.xls c_def.txt.xls i want to append date time stamp in the below manner. c_abc_new_YYYYMMDD_HH24MISS.txt.xls c_def_YYYYMMDD_HH24MISS.txt.xls check the two input file names, they differ in naming. the 1st file name... (9 Replies)
Discussion started by: Little
9 Replies

9. Shell Programming and Scripting

Files with date and time stamp

Hi Folks, Need a clarification on files with date and time stamp. Here is my requirement. There is a file created everyday with the following format "file.txt.YYYYMMDDHHMMSS". Now i need to check for this file and if it is available then i need to do some task to the file. I tried... (6 Replies)
Discussion started by: jayadanabalan
6 Replies

10. Shell Programming and Scripting

Perl:Script to append date and time stamp

Help with Perl script : I have a web.xml file with a line <display-name>some_text_here</display-name> Need to append the current date and time stamp to the string and save the XML file Something like <display-name>some_text_here._01_23_2014_03_56_33</display-name> -->Finally want... (5 Replies)
Discussion started by: gaurav99
5 Replies
clock(1m)																 clock(1m)

NAME
clock - A dcecp object that manages the clock on a local or remote host SYNOPSIS
clock compare [dts_entity] [-server dts_entity] clock help [operation | -verbose] clock operations clock set [dts_entity] {-to DTS_timestamp [-abruptly -epoch epoch_number | -bypass] | -epoch epoch_number} clock show [dts_entity] [-dtsd | -inetd | -dced] clock synchronize [dts_entity] [-dtsd [-abruptly] | -inetd | -dced] ARGUMENTS
Identifies the dtsd server or clerk to act on. With the -server option in the compare operation, dts_entity can identify a DTS time provider. When used without the -dced or -initd options, dts_entity can be either of the following: The name of a dtsd server, which can be on a remote host, in the format: /.../cellname/hosts/hostname/dts-entity A string binding for the remote host on which the dtsd is running, such as: ncacn_ip_tcp:130.105.1.227 Alternatively you can specify the binding in Tcl format, such as: {ncacn_ip_tcp 130.105.1.227} When used with the -dced or -inetd options, dts_entity identifies the server by a simple host name in the form hostname. The name of the clock operation for which to display help information. DESCRIPTION
The clock object represents the clock on a system and the time that it tells. This object has commands to display and set the time. The time setting functionality is provided by DTS, unless you specify either the -dced or -inetd option. The optional argument to the clock command is the name of a DCE Version 1.1 dtsd running on some machine. Without an argument, the _s(dts) convenience variable is checked. If this variable is not set, the command operates on the clock on the local machine. Use the -epoch option to change only the epoch number of the dtsd. OPERATIONS
clock compare Returns the difference between the clocks on the local machine and a DTS server in the cell. The syntax is as follows: clock compare [dts_entity] [-server dts_entity] Options Optionally names a specific DTS server against which to compare the host clock. See ARGUMENTS for the format of the dts_entity argument. The compare operation returns the difference between the clocks on the local machine and a DTS server in the cell. If a server is not specified, the command picks the last responding server returned by dts catalog. An optional argument compares a remote host's clock against a DTS server. An optional -server option compares the clock against a specific DTS server. The DTS server that responds to this operation may be communicating directly with an external time provider. If so, the provider attribute returned by this operation will be set to yes. Privileges Required You must have r (read) permission on /.:/hosts/hostname/dts-entity to execute the command. Examples dcecp> clock compare {server /.:/gumby/hosts/oddball/dts_entity} {provider no} {skew -0-00:00:00.020I-----} dcecp> dcecp> clock compare -server /.:/hosts/santafe/dts-entity {server /.:/hosts/santafe/dts-entity} {provider yes} {skew -0-00:00:00.292I1.431} dcecp> clock help Returns help information about the clock object and its operations. The syntax is as follows: clock help [operation | -verbose] Options Displays information about the clock object. Used without an argument or option, the clock help command returns brief information about each clock operation. The optional operation argument is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the clock object itself. Privileges Required No special privileges are needed to use the clock help command. Examples dcecp> clock help compare Returns the difference between the local clock and a server. set Sets the system clock to the specified time. show Returns the current time as a DTS style timestamp. synchronize Synchronizes the local clock with the specified server. help Prints a summary of command-line options. operations Returns a list of the valid operations for this command. dcecp> clock operations Returns a list of the operations supported by the clock object. The syntax is as follows: clock operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the clock operations command. Examples dcecp> clock operations compare set show synchronize help operations dcecp> clock set Sets the clock to the specified time. The syntax is as follows: clock set [dts_entity] {-to DTS_timestamp [-abruptly -epoch epoch_number | -bypass] | -epoch epoch_number} Options This option specifies a DTS timestamp as the time to which to set the clock. You can specify the time in the ISO-compliant time format, as follows: CCYY-MM-DD-hh:mm:ss.fff Specifies to set the clock abruptly rather than gradually adjust it to the computed time. Sets the system clock to the specified time without using DTS. Specifies an epoch_number that matches the epochs of servers with which the local clock synchronizes. The set operation sets the local clock to the specified time. An optional argument sets the clock on a remote host. The -to option speci- fies a DTS timestamp as the time to which to set the clock. If you do not specify the -abruptly option, DTS adjusts the clock gradually to the specified time. The -abruptly option changes to the specified time, without gradual adjustments. If you specify the -abruptly option, you must also specify the -epoch option to indicate a new epoch. You can also use the -epoch option without specifying a time to pull the specified dts_entity out of synchronization. The -bypass option causes DTS to be ignored and sets the system clock directly. This opera- tion returns an empty string on success. Note that setting your system clock is a dangerous operation. If your machine is not synchronized with other machines in the cell, other DCE services, especially CDS, do not operate correctly. See the OSF DCE Administration Guide for more information about DTS. Privileges Required You must have w (write) permission on the clock object (/.:/hosts/hostname/dts-entity) if using DTS to set the time, otherwise no special privileges are required. Examples dcecp> clock set -to 1994-07-15-16:27:28.000-04:00 -abruptly -epoch 1 dcecp> dcecp> clock set -epoch 5 dcecp> clock show Returns a DTS-style timestamp including the time differential factor (TDF). The syntax is as follows: clock show [dts_entity] [-dtsd | -inetd | -dced] Options Use dced services instead of DTS to report the time. Use inetd socket connections instead of DTS to report the time. Use DTS ser- vices to report the time (default). The show operation returns a DTS-style timestamp with the TDF indicated. Use the dts_entity argument to specify a remote host on which to show the clock. Two options let you specify that the time should be returned without using DTS services: The -dced option specifies that dced services should be used instead of DTS services The -inetd option specifies that inetd socket connections should be used instead of DTS Privileges Required You must have r (read) permission on the clock object (/.:/hosts/hostname/dts-entity) if using DTS to show the time, otherwise no special privileges are required. Examples dcecp> clock show 1994-07-15-16:28:02.229+00:00I----- dcecp> dcecp> clock show oddball -dced 1994-07-16-17:29:05.321+00:00I----- dcecp> clock synchronize Causes dtsd to synchronize with a server. The syntax is as follows: clock synchronize [dts_entity] [-dtsd [-abruptly] | -inetd | -dced] Options Causes the clock to be set abruptly rather than gradually adjusted to the computed time. Use dced services instead of DTS as the time source. Use inetd socket connections instead of DTS as the time source. Use DTS services as the time source. The synchronize operation causes the local dtsd to synchronize the local clock gradually with the cell time from DTS servers. The -abruptly option changes to the specified time immediately, without gradual adjustments. By default, the time is retrieved from DTS. If the -dced option is specified, the time is retrieved from dced services. If the -inetd option is specified, the time is retrieved from inetd socket connections. The optional dts_entry argument synchronizes the clock on the named remote host. This operation returns an empty string on success. Privileges Required You must have w (write) permission on the clock object (/.:/hosts/hostname/dts-entity) if using DTS to synchronize the time, otherwise no special privileges are required. Examples dcecp> clock synchronize dcecp> RELATED INFORMATION
Commands: dcecp(1m), dcecp_dts(1m), dcecp_utc(1m), dtsd(1m). clock(1m)
All times are GMT -4. The time now is 03:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy