On 08/01/2012 05:16 AM, Goffredo Baroncelli wrote:
> 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@xxxxxxxxxxxxxx>
>> ---
>> 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
>
I prefer to the first one, since I have no any idea how to sort by path
by then.
>
> Anyway, whichever your choice will be, please remember to update the man
> page too.
>
ah, I should have remembered to update it, thanks for reminding. :)
Will do it soon, thanks for reviewing this!
thanks,
liubo
>> NULL
>> };
>
> [...]
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html