[NTLUG:Discuss] Many Thanks RE: tar file with date?

m m llliiilll at hotmail.com
Tue Aug 5 11:27:42 CDT 2008


Thanks to You all!

----------------------------------------
> Date: Tue, 5 Aug 2008 11:24:53 -0500
> From: imageek72 at gmail.com
> To: discuss at ntlug.org
> Subject: Re: [NTLUG:Discuss] tar file with date?
> 
> its `date+'%Y%m%d'`
> 
> 
> On Tue, Aug 5, 2008 at 11:07 AM, m m  wrote:
>>
>> for some reason, it just don't work t me:
>>
>> see what I have tried:
>>
>> [root at P ~]# tar -cf zz+`date_%y%m%d`.tar install.log.syslog
>> bash: date_%y%m%d: command not found
>> [root at P ~]# tar -cf zz+`date+%y%m%d`.tar install.log.syslog
>> bash: date+%y%m%d: command not found
>> [root at P~]# tar -cvf zz+$(date+'%y%m%d').tar install.log.syslog
>> bash: date+%y%m%d: command not found
>> install.log.syslog
>> [root at P ~]# tar cvf zz+$(date+'%y%m%d').tar install.log.syslog
>> bash: date+%y%m%d: command not found
>> install.log.syslog
>> [root at P~]# tar cvf zz+$(date+'%y%m%d').tar install.log.syslog
>> bash: date+%y%m%d: command not found
>> install.log.syslog
>>
>>
>> Help and Thanks.
>>
>>
>> ----------------------------------------
>>> Date: Tue, 5 Aug 2008 10:58:40 -0500
>>> From: brog45 at gmail.com
>>> To: discuss at ntlug.org
>>> Subject: Re: [NTLUG:Discuss] tar file with date?
>>>
>>> On Tue, Aug 5, 2008 at 10:39 AM, m m  wrote:
>>>
>>>>
>>>> I am trying back the while directory with tar.
>>>> I want to have current date append to the backed up file name.
>>>> Google result is
>>>>
>>>> tar cvf backup_`date +%d%m%y`.tar
>>>>
>>>> however, it just don't work on my box.
>>>
>>>
>>>
>>> This works:
>>> tar cvf backup_$(date +'%d%m%y').tar
>>>
>>> But I recommend the following because it alphabetizes in chronological
>>> order:
>>> tar cvf backup_$(date +'%Y%m%d').tar
>>>
>>> /* Brian Rogers, professional geek, coffee achiever */
>>> _______________________________________________
>>> http://www.ntlug.org/mailman/listinfo/discuss
>>
>> _________________________________________________________________
>> Reveal your inner athlete and share it with friends on Windows Live.
>> http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
>>
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss

_________________________________________________________________
Reveal your inner athlete and share it with friends on Windows Live.
http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us


More information about the Discuss mailing list