linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Liu Bo <liubo2009@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/3] Btrfs-progs: list snapshots by generation
Date: Tue, 31 Jul 2012 23:16:48 +0200	[thread overview]
Message-ID: <50184B40.8010508@libero.it> (raw)
In-Reply-To: <1343713776-14232-3-git-send-email-liubo2009@cn.fujitsu.com>

Hi Bo,

On 07/31/2012 07:49 AM, Liu Bo wrote:
> The idea is that we usually use snapshot to backup/restore our data, and the
> common way can be a cron script which makes lots of snapshots, so we can end
> up with spending some time to find the latest snapshot to restore.
> 
> This adds a feature for 'btrfs subvolume list' to let it list snapshots by their
> _created_ generation.
> 
> What we need to do is just to list them in descending order and get the latest
> snapshot.  What's more, we can find the oldest snapshot as well by listing
> snapshots in ascending order.
> 
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
>  btrfs-list.c     |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  cmds-subvolume.c |   19 +++++-
>  2 files changed, 185 insertions(+), 10 deletions(-)
> 
[....]
>  
>  static const char * const cmd_subvol_list_usage[] = {
> -	"btrfs subvolume list [-p] <path>",
> +	"btrfs subvolume list [-ps] <path>",
>  	"List subvolumes (and snapshots)",
>  	"",
> -	"-p     print parent ID",
> +	"-p           print parent ID",
> +	"-s value     list snapshots with generation in ascending/descending order",
> +	"             (1: ascending, 0: descending)",

Please change the user interface. I suggest something like:

-s|-S		list snapshots with generation in ascending|descending
		order	

Or better

-s		sort by generation
-P		sort by path
-r		reverse the sort order


Anyway, whichever your choice will be, please remember to update the man
page too.

>  	NULL
>  };

[...]


  reply	other threads:[~2012-07-31 21:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  5:49 [PATCH 1/3 RESEND] Btrfs-progs: search subvolumes with proper objectid Liu Bo
2012-07-31  5:49 ` [PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list Liu Bo
2012-07-31  5:49 ` [PATCH 3/3] Btrfs-progs: list snapshots by generation Liu Bo
2012-07-31 21:16   ` Goffredo Baroncelli [this message]
2012-08-01 11:28     ` Liu Bo
2012-08-02  9:52   ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50184B40.8010508@libero.it \
    --to=kreijack@libero.it \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).