restore: Add regex matching of paths and files to be restored
authorPeter Stuge <peter@stuge.se>
Fri, 25 Nov 2011 00:03:58 +0000 (01:03 +0100)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:29 +0000 (14:32 +0200)
commite35450fa53139572afdd759619610cc7f5277626
treec85605727dd8fc2c5ead298d1fbff1489a401da6
parent3d86ac20b74a736c4b7e0881dac5ff4d3dbbcd11
restore: Add regex matching of paths and files to be restored

The option -m is used to specify the regex string. -c is used to
specify case insensitive matching. -i was already taken.

In order to restore only a single folder somewhere in the btrfs
tree, it is unfortunately neccessary to construct a slightly
nontrivial regex, e.g.:

restore -m '^/(|home(|/username(|/Desktop(|/.*))))$' /dev/sdb2 /output

This is needed in order to match each directory along the way to the
Desktop directory, as well as all contents below the Desktop directory.

Signed-off-by: Peter Stuge <peter@stuge.se>
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
cmds-restore.c