[xubuntu-users] Using the _date_ variable in tar files?

Ralf Mardorf ralf.mardorf at rocketmail.com
Mon Jul 20 23:04:58 UTC 2015


On Mon, 20 Jul 2015 22:48:16 +0100, Peter Flynn wrote:
>On 07/20/2015 10:11 PM, JMZ wrote:
>> sudo tar -cjvf /x/y/(date +%a_%b_%F_%T)-b.tar.bz2 /a/b/*
>> 
>It's A Bad Idea to use `date +%T` in filenames

Indeed, it's very unusual to use ":" in directory and file names.

JFTR Jordan, are you aware about globbing? The asterisk doesn't care
about hidden files/directories, so assumed you want to get hidden
files/directories too, you need to add them, IOW

/a/b/* /a/b/.hiddenfile1 /a/b/.hiddendir1

You don't need to care about hidden files in subdirectories, IOW you
don't need to add /a/b/c/.hiddenthingy1 .




More information about the xubuntu-users mailing list