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
Adding date and time to a log file ltodd2 UNIX for Dummies Questions & Answers 2 12-15-2008 01:37 PM
Adding date to oracle exp log KrisOracleGuy UNIX for Dummies Questions & Answers 1 11-06-2008 02:47 PM
Adding a date as a first column figaro UNIX for Dummies Questions & Answers 2 05-21-2008 06:00 PM
Grabing Date from filename and adding to the end of each line in the file. rkumar28 Shell Programming and Scripting 1 05-01-2007 09:25 PM
adding date to cron log JohnH Shell Programming and Scripting 2 09-18-2006 10:07 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 03-06-2009
vara32 vara32 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 2
adding date to a file during FTP

I have a very basic question here.
I have to FTP a file from a AIX unix box to a windows server.
But during that I have to rename the file.
For example:
I have to FTP a file called ORDER.TXT from unix and it should go as ORDER_20090101.TXT on to the windows server.

It is not possible to append the date before FTP or after FTP.

Can anybody suggest how to do this?
  #2 (permalink)  
Old 03-06-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
'man ftp' yields the following for the 'get':
Code:
     get remote-file [ local-file ]
           Retrieves the remote-file and store it  on  the  local
           machine.  If  the local file name is not specified, it
           is given the same name it has on the  remote  machine,
           subject to alteration by the current case, ntrans, and
           nmap settings. The current settings  for  "representa-
           tion  type", "file structure", and "transfer mode" are
           used while transferring the file.
E.g.:
Code:
get ORDER.TXT ORDER_20090101.TXT
the same is true for the 'put'.
  #3 (permalink)  
Old 03-06-2009
vara32 vara32 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 2
Thanks.
But the date should be autogenerated from the system date.
I have to embed that in a script.

ok.. does this work?

put ORDER.TXT ORDER_`date +"%Y%m%d%"`.TXT
  #4 (permalink)  
Old 03-06-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
Quote:
Originally Posted by vara32 View Post
Thanks.
But the date should be autogenerated from the system date.
I have to embed that in a script.

ok.. does this work?

put ORDER.TXT ORDER_`date +"%Y%m%d%"`.TXT
depending on your 'script' - looks good to me.
One way to find out though.......
  #5 (permalink)  
Old 03-09-2009
zTodd zTodd is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 23
If it doesn't work, might need quotes around your new filename, maybe all within the date function...
put ORDER.TXT `date +"ORDER_+%Y%m%d.TXT"`
  #6 (permalink)  
Old 03-09-2009
jpgleon jpgleon is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 6
Hello

There must be another way of do this, but here is another example:

name=`date "+_%Y%m%d"`
mv EARMDSQA.tar EARMDSQA$name.tar

Regards
Pura vida!
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 06:56 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