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
Perl: Extracting date from file name and comparing with current date MKNENI Shell Programming and Scripting 4 03-26-2008 04:01 PM
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
creating a new file with date stamp mgirinath Shell Programming and Scripting 2 02-28-2006 12:00 PM
Shell script for Creating Directory with name as system date aarora_98 Shell Programming and Scripting 7 12-07-2005 08:14 AM
Creating file with date/timestamp in it ccpjr29 Shell Programming and Scripting 7 03-04-2002 04:14 PM

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 05-08-2001
n9ninchd n9ninchd is offline
Registered User
  
 

Join Date: May 2001
Location: Bay Area
Posts: 25
Post

I would like to create an archive of backup files
In doing so I would like to be able to create a file basically called

filname.`date`.arch

With each try I get something completly different - so how do I get just say zip the entire directory >

filename.may092001.arch

Any ideas - I really botched that one - I need to know how to get all the other characters outta the date command and then use it as a variable to make the filename.
  #2 (permalink)  
Old 05-09-2001
alwayslearningunix
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
hey n9ninchd
I'm not sure if I understood your question, but if you just want the numerical date format you can just specify the date command to be format thus:

`date "+%m%d%y"` which will return 050901 for example (todays date - 9th May 2001)

Hope this helps.

Regards
  #3 (permalink)  
Old 05-09-2001
mib mib is offline
Registered User
  
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
if you have gnu date & tar:
use
Today=`date +%d-%B-%Y`     # 09-May-2001
tar czvf $Today.arch.gz dirname

HTH
  #4 (permalink)  
Old 05-09-2001
n9ninchd n9ninchd is offline
Registered User
  
 

Join Date: May 2001
Location: Bay Area
Posts: 25
Thank You to the both of you.
Both scenarios work well, and both work in the areas that I needed.

Once again thank you so much
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 03:53 PM.


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