Enable the quiet option to the btrfs(8) subvolume snapshot command.
Does the job quietly. For example:
btrfs -q subvolume snapshot <src> <dest>
Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
---
cmds/subvolume.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cmds/subvolume.c b/cmds/subvolume.c
index 9c8fe35a2aae..dbfa40d1549a 100644
--- a/cmds/subvolume.c
+++ b/cmds/subvolume.c
@@ -669,6 +669,8 @@ static const char * const cmd_subvol_snapshot_usage[] = {
"-r create a readonly snapshot",
"-i <qgroupid> add the newly created snapshot to a qgroup. This",
" option can be given multiple times.",
+ HELPINFO_INSERT_GLOBALS,
+ HELPINFO_INSERT_QUIET,
NULL
};
@@ -783,11 +785,13 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
if (readonly) {
args.flags |= BTRFS_SUBVOL_RDONLY;
- printf("Create a readonly snapshot of '%s' in '%s/%s'\n",
- subvol, dstdir, newname);
+ pr_verbose(-1,
+ "Create a readonly snapshot of '%s' in '%s/%s'\n",
+ subvol, dstdir, newname);
} else {
- printf("Create a snapshot of '%s' in '%s/%s'\n",
- subvol, dstdir, newname);
+ pr_verbose(-1,
+ "Create a snapshot of '%s' in '%s/%s'\n",
+ subvol, dstdir, newname);
}
args.fd = fd;
--
2.25.1