[NTLUG:Discuss] tar file with date?
./aal
al_h at technologist.com
Tue Aug 5 12:10:54 CDT 2008
On Tue, Aug 5, 2008 at 11:07 AM, m m <llliiilll at hotmail.com> 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
>
Looks like you are using tilde ( ` ) and not single quote ( ' )
they are easy to mix up depending on the font you use to view your email.
Try swapping and see what happens
--
Paula Poundstone - "I don't have a bank account because I don't know
my mother's maiden name."
More information about the Discuss
mailing list