Sponsored Content
Top Forums Shell Programming and Scripting Amend File Without Changing Timestamp Post 302739351 by Ste_Moore01 on Tuesday 4th of December 2012 05:38:27 AM
Old 12-04-2012
Thanks Don.

I realised what Peasant meant with his post and it worked perfectly.

Thanks for the info on touch -m though.
 

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
GMDATE(3)								 1								 GMDATE(3)

gmdate - Format a GMT/UTC date/time

SYNOPSIS
string gmdate (string $format, [int $timestamp = time()]) DESCRIPTION
Identical to the date(3) function except that the time returned is Greenwich Mean Time (GMT). PARAMETERS
o $format - The format of the outputted date string. See the formatting options for the date(3) function. o $timestamp - The optional $timestamp parameter is an integer Unix timestamp that defaults to the current local time if a $timestamp is not given. In other words, it defaults to the value of time(3). RETURN VALUES
Returns a formatted date string. If a non-numeric value is used for $timestamp, FALSE is returned and an E_WARNING level error is emitted. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | The valid range of a timestamp is typically from | | | Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 | | | 03:14:07 GMT. (These are the dates that corre- | | | spond to the minimum and maximum values for a | | | 32-bit signed integer). However, before PHP 5.1.0 | | | this range was limited from 01-01-1970 to | | | 19-01-2038 on some systems (e.g. Windows). | | | | | 5.1.1 | | | | | | | There are useful constants of standard date/time | | | formats that can be used to specify the $format | | | parameter. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 gmdate(3) example When run in Finland (GMT +0200), the first line below prints "Jan 01 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00". <?php echo date("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998)); echo gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998)); ?> SEE ALSO
date(3), mktime(3), gmmktime(3), strftime(3). PHP Documentation Group GMDATE(3)
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy