IN THIS ARTICLE
Outlines how to identify file changes between two snapshots of the same directory
- Cluster running Qumulo Core 2.8.5 and above
NOTE: The snapshots being compared need to be taken on version 2.8.5 or above.
Using Qumulo's API, file changes between two snapshots of the same directory can easily be identified. Each entry in the returned list will detail the CREATE, MODIFY, or DELETE change operation and will contain the path of the changed file.
IMPORTANT! The time to discover all the changes is proportional to the number of files changed and not to the number of total files in the directory.
Identify the File Changes
First you'll need to identify the Snapshot IDs for the point in times you will be referencing.
- Login to the Qumulo Core Web UI
- Hover over Cluster and click Saved Snapshots
- Copy the Snapshot IDs for the first and last timepoints from the Created/Snapshot Name Column
Once you have the IDs, you can use the following qq command replacing the bold ID_HERE portions with the appropriate snapshot IDs to list the file changes.
qq snapshot_diff --newer_snapshot ID_HERE --older_snapshot ID_HERE
Change operations will be included in the results list as specified by the details below:
- Directories are shown with a trailing slash in their path
- When directories are created or deleted, it’s assumed that all files under them are created or deleted as well
- Renames appear as a delete of the old name and a create of the new name
- Adding links to a file (hardlinking) appears as a create of the new link’s path
Below you'll find an output example where the following steps were taken before using the snapshot_diff API:
- Snapshot an empty directory /mchmiel/
- Add a directory /mchmiel/new_dir/
- Make a new file in that directory /mchmiel/new_dir/file
- Make a new top level file /mchmiel/new_file
- Snapshot the directory /mchmiel/
From the results list above, the new_dir/ was created and it’s assumed any data inside that directory was also created. The output also displays that new_file was created. Lastly, the directory /mchmiel/ was modified because children inside it were added, modifying its timestamps.
The output below displays the returned list after deleting all the data in the /mchmiel/ directory.
The directory and all its contents, including the file, were deleted as described. The parent directory was modified since it had children deleted, updating its timestamps.
Pagination of Results
- Page sizes can be used to retrieve up to 10,000 results per call. The default is 1,000 results.
- If there are more results to retrieve, a “next” endpoint will be generated and output. Using this endpoint will retrieve the next data set.
Keep in mind that differences between two snapshots will always be ordered in the same way no matter how many times you call the API or what combination of page sizes you use.
You should now be able to successfully identify file changes between between two Snapshots of the same directory
Like what you see? Share this article with your network!