3.3.6 List Clones and Snapshots

To display information about related files, clones, and snapshots, use the ESCLI lssnapshots command. This command has two principal modes of operation:

  • To display information about the snapshots that are based on a specific file, use the lssnapshots command and specify the file that is the subject of the command. The specified file can be a snapshot, clone, or regular file. For example:

    @> lssnapshots @myvaultname/file1
    name
    @myvaultname/file1
    @myvaultname/snap2_of_file1
    @myvaultname/snap1_of_file1
    

    As shown in the example, a simple form of the command displays the snapshots that are directly based on the specified file.

    Using the command options available with the lssnapshots command, you can also:

    • Filter the output according to your specified conditions.
    • Sort the output using specific attributes.
    • Choose to display output with different levels of detail.
  • To display information about related files, clones, and snapshots, use the lssnapshots command and specify a file name in conjunction with the --all option or the --tree option.

    Both options display information about all files, clones, and snapshots belonging to the snapshot tree that contains the specified file. The specified file can be a snapshot, clone, or regular file at any level in the snapshot tree. No other command options are permitted in conjunction with the --all option or the --tree option.

    For example, consider a group of related files that is based on the following command sequence:

    @myvaultname/> putfile somelocalfile file1
    Putting file somelocalfile to @myvaultname/file1
    Success.
    
    @myvaultname/> snapshotfile file1 snap1_of_file1
    Success.
    
    @myvaultname/> clonefile file1 clone1
    Success.
    
    @myvaultname/> snapshotfile file1 snap2_of_file1
    Success.
    
    @myvaultname/> snapshotfile clone1 snap1_of_clone1
    Success.
    

    The following example shows how to display related files using the --all command option. The output is presented in a series of lists. The first list contains the files and clones in the snapshot tree. The remaining output lists snapshots that are grouped by their source file.

    @> lssnapshots @myvaultname/clone1 --all
    
    ---FILE/CLONES:---
    
    2022-05-02 06:14:41 UTC @myvaultname/file1
    2022-05-02 06:15:15 UTC @myvaultname/clone1
    
    ---SNAPSHOTS:---
    
    @myvaultname/file1
      2022-05-02 06:15:06 UTC @myvaultname/snap1_of_file1
      2022-05-02 06:15:15 UTC @myvaultname/?8000_0000_000a:00000001
      2022-05-02 06:15:24 UTC @myvaultname/snap2_of_file1
    
    @myvaultname/clone1
      2022-05-02 06:15:45 UTC @myvaultname/snap1_of_clone1
    
    

    Note that the command output includes an internal snapshot (@myvaultname/?8000_0000_000a:00000001), which was implicitly created as part of the cloning operation to create @myvaultname/clone1.

    The following example shows how to display related files in a snapshot tree using the --tree command option.

    @> lssnapshots @myvaultname/clone1 --tree
    
    +---- [1] @myvaultname/snap1_of_file1
    +---- [2] @myvaultname/?8000_0000_000a:00000001
    |
    |`---+---- [4] @myvaultname/snap1_of_clone1
    |    +---- [6] @myvaultname/clone1
    |
    +---- [3] @myvaultname/snap2_of_file1
    +---- [5] @myvaultname/file1