The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Processing a log file based on date/time input and the date/time on the log file primp Shell Programming and Scripting 4 03-16-2008 11:23 AM
Unix File creation time tinivt Shell Programming and Scripting 2 01-23-2007 06:27 AM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 07:15 AM
Listing the creation date/time of a file in unix unipepper Shell Programming and Scripting 6 02-15-2006 07:10 AM
file creation time sskb UNIX for Dummies Questions & Answers 1 10-04-2001 12:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-07-2005
alisevA3 alisevA3 is offline
Registered User
  
 

Join Date: May 2002
Posts: 33
file creation date & time

Hi All,

I have some files which are creates every day using a script. I want to create a log files which does write "filename,creation day and time"
how can I do this ??


Alice
  #2 (permalink)  
Old 07-07-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Getting the time of creation is not easy especially if you modify the file after it is created.

This script will work just the way you want, if the newly created files are not modified after their creation.

From within the directory where you need to run the script

Code:
cd /path/to/dir
ls -l | awk '{ printf $9 "-" $6" " $7" " $8"\n" }' >> output.txt
Vino
  #3 (permalink)  
Old 07-08-2005
vibhor_agarwali vibhor_agarwali is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 259
A bit funky but might solve your problem.

In the script which is creating the file just write before the action statement a similar echo statement.
Like

echo touch tmp > log
echo `date` > log
touch tmp
  #4 (permalink)  
Old 07-08-2005
alisevA3 alisevA3 is offline
Registered User
  
 

Join Date: May 2002
Posts: 33
thank you

it works well. thank you to all
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0