Yes, I do everything the hard way :-)  

Didn't even occur to me to use the back ticks in the 
command itself. Shows you how often I use back ticks.

Miark



Tim Holmes <[EMAIL PROTECTED]> spoke thusly:

> Just add an executable line to the name of the tar.gz by using date.
> Pretty simple.  I do it all the time.
> 
> tar -zxf /path/to/file-`date +%m-%d-%y`.tar.gz /path/to/dir/to/backup
> 
> You'll end up with /path/to/file-03-26-02.tar.gz
> 
> Check out date --help for all the possible flags, so you can get your
> tar file as specific as you'd like.  Including the time, just the day
> and month, format, etc;
> 
> Hope that helps ya.
> tdh
> 
> -- 
>  --------------------------------------------------------------------
>  T. Holmes  |  UNIXTECHS.org  |  [EMAIL PROTECTED]  |  UIN:  17021091
>  --------------------------------------------------------------------
> | I have a script I use to backup some important files in my home directory. It 
>works fine but I would like it to add the curent date to the file name IE: 
>backup-03-26-02.tar.gz instead of just backup.tar.gz
> | Any suggestions on how to do this? I looked in the tar man and tar howto but 
>couldn't find exact syntax for the current date.
> | thanks
> | 
> 
> | Want to buy your Pack or Services from MandrakeSoft? 
> | Go to http://www.mandrakestore.com
> 
> `------------------------------------------------------------------- 
> 
> 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to