Sponsored Content
Top Forums Shell Programming and Scripting Amend File Without Changing Timestamp Post 302739345 by Don Cragun on Tuesday 4th of December 2012 05:08:05 AM
Old 12-04-2012
Actually:
Code:
touch -r file1 file2...

will set the access time and the modification time of file2 and any other file operands to match the access time and the modification time of file1. If you just want to reset the modification time, use:
Code:
touch -m -r file1 file2...

This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

changing timestamp of a file

How can I change teh timestamp of a file (1 Reply)
Discussion started by: krishan
1 Replies

2. Shell Programming and Scripting

Script to backup multiple files and amend their filenames

Hi, I'm trying to write a command that backs up certain files into my current directory and adds a prefix to the backed up file name. I realise this can be done in a script by specifying each individual file but would like to know if it can be done on one line and made an alias. I have the... (5 Replies)
Discussion started by: m223464
5 Replies

3. Solaris

Amend the size of a Partition Error

Hi guys, I'm fidling around Partition space on SMC and on changing partition size, or assiging an unused partition to "usr", or even trying to alter the disk layout I get: Attempted Format of Partition /dev/dsk/c1t0d0s3 failed with unexpected CIM error: CIM_ERR_FAILED:CIM_ERR_FAILED:... (2 Replies)
Discussion started by: drchris
2 Replies

4. Shell Programming and Scripting

amend ftp to sftp

Hi all, below is my current scriptftp -n << FTPCTRL open $my_ip user $my_user $my_pass ascii prompt off lcd $myDIR cd $ftp_cd $OPS $myfile FTPCTRLI'd like to amend it to sftp mode. Please advise the correct step.I consulted the man pages of sftp and I suppose I should be using the... (1 Reply)
Discussion started by: new2ss
1 Replies

5. UNIX for Advanced & Expert Users

Amend Unix hostname

Hi, Please could someone advise on the following if possible. I have built a unix server, and was given the wrong hostname. I need to amend the hostname to the correct name. And I don't want to rebuild the server again. I've tried the following to do change : hostname DTCT-TD3FIXI01A... (3 Replies)
Discussion started by: venhart
3 Replies

6. Shell Programming and Scripting

How to replace and amend value in the same time

2009/03/30 08:11:34.553 DFP 2009/03/30 08:11:36.861 PLO I want it to be 2009/03/30 09:11:34.553 DFP 2009/03/30 09:11:36.861 PLO and 2009/03/30 23:11:34.553 DFP 2009/03/30 23:11:36.861 PLO to be 2009/03/30 00:11:34.553 DFP 2009/03/30 00:11:36.861 PLO Can we use sed or... (4 Replies)
Discussion started by: lalelle
4 Replies

7. UNIX for Advanced & Expert Users

Changing timestamp file in crontab

Hi All I want to change the date timestamp for the log file but to do it within crontab I've tried the following.. 40 11 * * * /data/dart/dc65.1/bin/adstats.sh > /data/dart/dc65.1/bin/adstats_`date'+%d:%m-%H.%M.%S'`.log 2>&1 But I only get adstats_ Any ideas? Thanking you all... (4 Replies)
Discussion started by: Zak
4 Replies

8. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

9. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

10. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies
NTP(8)							      System Manager's Manual							    NTP(8)

NAME
ntp - query an ntp clock SYNOPSIS
ntp [-v] [-s] [-f] hosts... DESCRIPTION
ntp sends an ntp packet to the ntp daemon running on each of the given hosts. A daemon fills in fields of the ntp packet as per RFC-???? and sends the packet back. ntp then formats and prints the result on the standard output. The default output shows the delay, offset, and date in ctime() format. Options can reset the time of the local system clock. OPTIONS
-v Verbose output, showing the full contents of received ntp packets, plus caluclated offset, displacement, etc. -s Set system time-of-day clock. Will only happen if time offset is less than compiled-in constant WAYTOBIG (currently 1000 seconds). Will not happen if remote host is unsynchronized. -f Force setting system clock regardless of offset. Must be used with -s option. Still will not reset clock if remote system is unsynchronized. NTP RESULTS
The default output for each host looks like this: 128.8.10.1: delay:1.845207 offset:-0.358460 Mon Mar 20 08:05:44 1989 The verbose output for each host looks like this: Packet from: [128.8.10.1] Leap 0, version 1, mode Server, poll 6, precision -10 stratum 1 (WWVB) Synch Distance is 0000.1999 0.099991 Synch Dispersion is 0000.0000 0.000000 Reference Timestamp is a7bea6c3.88b40000 Tue Mar 7 14:06:43 1989 Originate Timestamp is a7bea6d7.d7e6e652 Tue Mar 7 14:07:03 1989 Receive Timestamp is a7bea6d7.cf1a0000 Tue Mar 7 14:07:03 1989 Transmit Timestamp is a7bea6d8.0ccc0000 Tue Mar 7 14:07:04 1989 Input Timestamp is a7bea6d8.1a77e5ea Tue Mar 7 14:07:04 1989 umd1: delay:0.019028 offset:-0.043890 Tue Mar 7 14:07:04 1989 The various fields are interpreted as follows: Packet from: [address] The address that this ntp packet was received from. Leap indicator: n The leap second indicator. Non-zero if there is to be a leap second added or subtracted at the new year. Status: n Stratum: n (source) The stratum of the clock in the NTP hierarchy, along with the source of the clock, either the name of a reference standard (such as WWVB or GOES) or the Internet address of the clock that this clock is derived from. Poll = n The desired poll rate of the peer. Precision = exponent (dec) The claimed precision of the clock, in seconds. Synchronizing Dist is ??? Synchronizing Dispersion is ??? The next five timestamps are given as NTP fixed-point values, in both hexadecimal and ctime(3). These are set either by this ntp process, or by the server we are quering. Reference Timestamp is hex-timestamp ctime string The last time the server clock was adjusted. (remote time) Originate Timestamp is hex-timestamp ctime string When the ntp request was transmitted by us to the server. (local time) Receive Timestamp is hex-timestamp ctime string When the ntp request was received at the server. (remote time) Transmit Timestamp is hex-timestamp ctime string When the ntp response was transmitted by the server. (remote time) Input Timestamp is hex-timestamp ctime string When the ntp response was received by us. (local time) hostname: delay:time offset:time The summary of the results of the query, giving the hostname of the responding clock (from the command line), the round-trip delay, and the offset between the two clocks (assuming symmetric round-trip times). BUGS
Using ntp with the current host will show inaccurate results. Probably a few others. Report bugs to Louis A. Mamokos (louie@trantor.umd.edu). SEE ALSO
RFC-???? Network Time Protocol(1), Dave Mills and ... ntpd(8), ntpdc(8) 30 July 1988 NTP(8)
All times are GMT -4. The time now is 10:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy