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
Convert Epoch time format to normal date time format in the same file rk4k Shell Programming and Scripting 3 11-19-2008 10:04 PM
problem with displaying date and adding time FuncMx Shell Programming and Scripting 1 10-10-2008 12:06 AM
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
Grabing Date from filename and adding to the end of each line in the file. rkumar28 Shell Programming and Scripting 1 05-01-2007 08:25 PM
how do I put a date and time in a file name jhamm UNIX for Dummies Questions & Answers 2 01-16-2007 09:31 AM

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

Join Date: Dec 2008
Posts: 2
Adding date and time to a log file

Morning all

Im hoping you can help me. We have a nice new oracle server and are needing to move some files around for EDI and BACS. The server runs windows but has an app called MKS toolkit installed which give unix commands. (Needed for the oracle stuff) I have had a go using dos commands in a batch file and also using things like touch but am not getting anywhere.
What im wanting it to copy files from the out folder into an edi folder and then move the files from the original out to an archive. Im wanting to log what is copied and moved. They want it to run every 10mins so I would like to create one log file per day and have the time in the file before the files are copied so we can look back and see what happend at what time.
My current attempt:
copy /V E:\oracle\uatcomn\admin\out\UAT_wendy\p??????.mf e:\edi\edi_out >> e:\edi\copy.log this works but just adds and adds.

This is probably very simple but its beating me

Thanks

Lee
  #2 (permalink)  
Old 12-15-2008
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,575
Dont know about DOS... why arent you using your MKS toolkit shell to do the job then?

This will show you the idea:
Code:
ant:/home/vbe $ echo "Date: " $(date)
Date:  Mon Dec 15 15:30:35 MET 2008
All you have to do is redirect that line (>>) in you log, then do the copy/moves etc...
  #3 (permalink)  
Old 12-15-2008
ltodd2 ltodd2 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 2
VBE

Thanks for the hint, Im not good at scripts, still learning. How would I make a file with that days date and within that file prefix each set of data with the time?

Lee
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix commands, unix scripting, unix scripting basics

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 09:49 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