Sponsored Content
Top Forums UNIX for Advanced & Expert Users update files and preserve date Post 302388451 by migurus on Wednesday 20th of January 2010 01:07:34 PM
Old 01-20-2010
update files and preserve date

I have a bunch of historical files that need to be modified, as the file source announced there is an error in them which should be corrected.

I am planning to use sed to do the mass update, but I would like to know if there is a way to preserve files last modified date/time, so later ls -ltr lists will show me when files were obtained, not when I updated them.

Any idea?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp copy: preserve source file date stamp

Is there any way to preserve a file's create/mod date stamp when it is "put" via ftp (or even using Fetch) to a Win2K server and a SunOS 5.8 server? For example, if I copy a file with a create/mod date of "01/15/2005 3:36 PM" to my Win2K or SunOS ftp server, the date stamp will change to the... (5 Replies)
Discussion started by: cassj
5 Replies

2. UNIX for Dummies Questions & Answers

File update date

I am facing a peculiar problem with file update dates. In my network, if i telnet to machine A and check the files in dir test of machine A, the dates for the last update shown are true dates and upto date. If the same folder is checked through some other machine by sharing the test folder and... (2 Replies)
Discussion started by: amne
2 Replies

3. Shell Programming and Scripting

Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies

4. Shell Programming and Scripting

how to update date part with new increment date time

hi experts, my requirement is like this i need to develop a shell script to update date part with new incremental date time in file some 'X' which is kept at some server location incrementing every two hours.as i am new to this scripting i need support from u people,thanx in advance (1 Reply)
Discussion started by: amanmro
1 Replies

5. Shell Programming and Scripting

Date Format - preserve whitespace

I am trying to change the date format for the following: YESTER=`TZ=aaa24 date +%b" "%d | sed 's/0/ /'` TraceList=$(ls -ltR /pdt/logs | grep "$YESTER" | awk '{print $9}') CMD2=$(find /disk/dan/dansFiles/pass/logs/$TList -name cmd\* -prune) what I am trying to do in the above... (1 Reply)
Discussion started by: ther2000
1 Replies

6. Fedora

Unable to Update Date

Hi everyone, Thanks for your help with this. I'm running an AWS EC2 instance (ami-2bc05345) and the time has been drifting. I have a different server using the same instance where the time is fine. NTP seems to be installed and be running (I uninstalled it and reinstalled it via Yum, just to... (4 Replies)
Discussion started by: AaronLS2
4 Replies

7. Shell Programming and Scripting

How to list files that are not first two files date & last file date for every month-year?

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies

8. UNIX for Dummies Questions & Answers

How to update a date dynamically using sed?

hi guys, i need to update a date in my config file via shell file M using this statement but it is not working ...any suggestions cat $CONFIG_FILE | sed -e 's/START_RUN_DATE=$START_RUN_DATE/START_RUN_DATE=$NEW_END_DATE/g' > srap_config_new.txt (1 Reply)
Discussion started by: ravidwivedi2288
1 Replies

9. UNIX for Dummies Questions & Answers

Replace with last date update

Dear Masters, I have file input 20140901|Cross Nation|Asia 20140908|Cross Region|Europe 20140905|Cross Nation|Europe I want to replace column 1 with the last date update, so my output should be like 20140908|Cross Nation|Asia 20140908|Cross Region|Europe 20140908|Cross Nation|Europe ... (7 Replies)
Discussion started by: radius
7 Replies
ELVREC(1)						      General Commands Manual							 ELVREC(1)

NAME
elvrec - Recover the modified version of a file after a crash SYNOPSIS
elvrec [preservedfile [newfile]] DESCRIPTION
If you're editing a file when elvis dies, the system crashes, or power fails, the most recent version of your text will be preserved. The preserved text is stored in a special directory; it does NOT overwrite your text file automatically. The elvrec program locates the preserved version of a given file, and writes it over the top of your text file -- or to a new file, if you prefer. The recovered file will have nearly all of your changes. To see a list of all recoverable files, run elvrec with no arguments. FILES
/usr/preserve/p* The text that was preserved when elvis died. /usr/preserve/Index A text file which lists the names of all preserved files, and the names of the /usr/preserve/p* files which contain their preserved text. BUGS
elvrec is very picky about filenames. You must tell it to recover the file using exactly the same pathname as when you were editing it. The simplest way to do this is to go into the same directory that you were editing, and invoke elvrec with the same filename as elvis. If that doesn't work, then try running elvrec with no arguments, to see exactly which pathname it is using for the desired file. Due to the permissions on the /usr/preserve directory, on UNIX systems elvrec must be run as superuser. This is accomplished by making the elvrec executable be owned by "root" and setting its "set user id" bit. If you're editing a nameless buffer when elvis dies, then elvrec will pretend that the file was named "foo". AUTHOR
Steve Kirkendall kirkenda@cs.pdx.edu ELVREC(1)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy