:: [DNG] Globbing rsync != tar ?
Top Page
Delete this message
Reply to this message
Author: Ken Dibble
To: dng
Subject: [DNG] Globbing rsync != tar ?
In my never ending quest to cause myself headaches, I have been
experimenting with
different backup methods.

What I am seeing is as follows:
rsync using a .gitignore file and tar using a the same.gitignore file
have different opinions
about globbing.

Here are the commands for reference

rsync -a -r -t -p -o -g -s --exclude-from=.gitignore /home/kdibble

tar --exclude-vcs-ignores -c /home/kdibble > /tmp/kdibble.tar

According to gnu.org tar 1.34 section 6.4


    Before archiving a directory, see if it contains any of the
following files: ‘cvsignore’, ‘.gitignore’, ‘.bzrignore’, or
‘.hgignore’. If so, read ignore patterns from these files.

    The patterns are treated much as the corresponding VCS would treat
them, i.e.:


    Contains shell-style globbing patterns. Applies to the directory
where ‘.gitfile’ is located         and all its subdirectories.

    Any line beginning with a ‘#’ is a comment. Backslash escapes the
comment character.

here is /home/kdibble/.gitignore

#.gitignore for home directory

After rsync:
  $ ls /tmp/backup_test | grep binary_data
  $ ls /tmp/backup_test | grep "o.d"

After tar:
  $ tar tf /tmp/kdibble.tar | grep binary_data

  $ tar tf /tmp/kdibble.tar | grep "o.d"

   I understand that the documentation says "much as the corresponding
VCS would treat them"



   IF they are not going to work the same, don't make it sound as
though they do work
   the same or name the command line switch like they do. Especially on
utilities used
   for backing up data, where there is an expectation of being able to
restore what
   you intended to back up.

   For reference the '**' glob was apparently introduced with Bash 4 in
   so it isn't something new.

   Then again, maybe I am missing something....

   Hoping to be enlightened,