[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Archiving content of a directory on a DVD-R.



On Mon, Nov 05, 2018 at 09:04:58AM -0500, Greg Wooledge wrote:
> On Sun, Nov 04, 2018 at 07:29:53AM -0800, peter@easthope.ca wrote:
> > How is this for archiving the content of a directory?
> > 
> >   pushd <aDirectory> ;
> >   printf "Insert blank DVD-R."; read t ;
> >   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;
> 
> Be aware that the * glob will probably miss filenames beginning with
> a dot [...]

Greg, as ever :-)

No, seriously: thanks for your constant work here. I do learn quite a
bit from your posts, even if I consider myself as somewhat seasoned.

> inside the script, to make the * glob include "dot files".  That's
> assuming you want to retain the current archive appearance.
> 
> The alternative would be to use . instead of * as tar's starting
> point.  This would change your archive appearance from

+1 on .

> .bashrc
> bin/foo
> lib/libbar.a
> 
> to
> 
> ./.bashrc
> ./bin/foo
> ./lib/libbar.a

If you don't want that, you can use (GNU) tar's wonderful file path
transformation magic, e.g.:

  tar -vcpzf - --xform='s/^\.\///' . | xorriso ...

(it takes an sed expression there).

Cheers
-- t

Attachment: signature.asc
Description: Digital signature


Reply to: