From patchwork Thu Jun 19 01:27:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 4380211 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69E409F26E for ; Thu, 19 Jun 2014 01:32:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95AFE20380 for ; Thu, 19 Jun 2014 01:32:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAF2220386 for ; Thu, 19 Jun 2014 01:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756850AbaFSBcD (ORCPT ); Wed, 18 Jun 2014 21:32:03 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:23499 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756872AbaFSBcA (ORCPT ); Wed, 18 Jun 2014 21:32:00 -0400 X-IronPort-AV: E=Sophos;i="5.00,735,1396972800"; d="scan'208";a="32121234" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Jun 2014 09:28:49 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s5J1VRrc019668 for ; Thu, 19 Jun 2014 09:31:27 +0800 Received: from wangs.fnst.cn.fujitsu.com (10.167.226.104) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 19 Jun 2014 09:31:27 +0800 From: Wang Shilong To: Subject: [PATCH 6/6] Btrfs-progs: btrfs-restore, document updates Date: Thu, 19 Jun 2014 09:27:09 +0800 Message-ID: <1403141229-25565-6-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403141229-25565-1-git-send-email-wangsl.fnst@cn.fujitsu.com> References: <1403141229-25565-1-git-send-email-wangsl.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.104] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add some missing options, also improve some confusing expressions. Signed-off-by: Wang Shilong --- Documentation/btrfs-restore.txt | 26 ++++++++++++++++++-------- cmds-restore.c | 7 ++++--- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Documentation/btrfs-restore.txt b/Documentation/btrfs-restore.txt index d774343..85b0797 100644 --- a/Documentation/btrfs-restore.txt +++ b/Documentation/btrfs-restore.txt @@ -24,7 +24,7 @@ https://btrfs.wiki.kernel.org/index.php/Restore OPTIONS ------- -s:: -get snapshots. +get snapshots, btrfs restore skips snapshots in default. -x:: get extended attributes. @@ -38,17 +38,17 @@ ignore errors. -o:: overwrite directories/files in . --t :: -use to read root tree. +-t :: +use to read root tree. --f :: -use to read fs tree. +-f :: +only restore files that are under specified root whose root bytenr is . --u :: -use given superblock mirror identified by . +-u :: +use given superblock mirror identified by , it can be 0,1,2. -r :: -use as root objectid. +only restore files that are under specified root whose objectid is . -d:: find dir. @@ -56,6 +56,16 @@ find dir. -l:: list tree roots. +-D|--dry-run:: +dry run (only list files that would be recovered). + +--path-regex :: +restore only filenames matching regex, you have to use following syntax (possibly quoted): +^/(|home(|/username(|/Desktop(|/.*))))$ + +-c:: +ignore case(--path-regrex only). + EXIT STATUS ----------- *btrfs restore* returns a zero exist status if it succeeds. Non zero is diff --git a/cmds-restore.c b/cmds-restore.c index 3a29ed6..74f35a4 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1111,9 +1111,9 @@ const char * const cmd_restore_usage[] = { "-v verbose", "-i ignore errors", "-o overwrite", - "-t tree location", - "-f filesystem location", - "-u super mirror", + "-t tree location", + "-f filesystem location", + "-u super mirror", "-r root objectid", "-d find dir", "-l list tree roots", @@ -1122,6 +1122,7 @@ const char * const cmd_restore_usage[] = { " restore only filenames matching regex,", " you have to use following syntax (possibly quoted):", " ^/(|home(|/username(|/Desktop(|/.*))))$", + "-c ignore case(--path-regrex only)", NULL };