{"id":21601559,"url":"https://github.com/vmware-archive/snapshot-diff-library","last_synced_at":"2025-07-17T04:31:04.169Z","repository":{"id":98087294,"uuid":"366147404","full_name":"vmware-archive/snapshot-diff-library","owner":"vmware-archive","description":"Snapshot diff wrapper library uses raw diff exposed by backend VDFS file system and produces easy to consume diff between 2 snapshots.","archived":true,"fork":false,"pushed_at":"2021-06-14T17:53:45.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-24T19:09:51.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T18:59:07.000Z","updated_at":"2024-04-12T01:52:39.000Z","dependencies_parsed_at":"2023-06-02T21:00:41.199Z","dependency_job_id":null,"html_url":"https://github.com/vmware-archive/snapshot-diff-library","commit_stats":null,"previous_names":["vmware-archive/snapshot-diff-library"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fsnapshot-diff-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fsnapshot-diff-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fsnapshot-diff-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fsnapshot-diff-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware-archive","download_url":"https://codeload.github.com/vmware-archive/snapshot-diff-library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226209967,"owners_count":17590497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T19:09:53.797Z","updated_at":"2024-11-24T19:09:54.817Z","avatar_url":"https://github.com/vmware-archive.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Introduction**\u003cbr/\u003e\n\nSnapshot diff wrapper library uses raw diff exposed by backend VDFS file system\nand produces easy to consume diff between 2 snapshots.  It can be directly\nintegrated with the backup program. The library is compatible with Windows and\nLinux. The library also provides snapshot-diff utility to create diff from\ncommand line.\n\n**Interface**\u003cbr/\u003e\n\nGetSnapshotDiff(`snapshot dir`, `first snapshot name`, `second snapshot name`, `output dir`, `generate json`)\n - `snapshot dir` is the path to vdfs directory containing all snapshots\n - `output dir` is the path to the directory where the serialized_diff and\n   parallel_diff will be stored (see below)\n- `generate json` should be set to `true` if json format output is needed.\n\n**Output directory layout**\u003cbr/\u003e\n\n`parallel_diff` contains diff items arranged by level (lower level needs\nto be run first).\n`serialized_diff` contains all diff items in order.\n`serialized_json` contains the diff items in json format (details below).\n`raw` will contain intermediary fragments of the diff.\n```\n\u003coutput dir\u003e\n    |--- serialized_diff\n    |--- serialized_json\n    |      |--- 0.json\n    |      |--- 1.json\n    |--- parallel_diff\n    |      |--- 0\n    |      |--- 514\n    |      |--- 515\n    |      |--- 1026\n    |--- raw\n    |      |--- 0\n    |      |--- 2\n    |      |--- 3\n    |      |--- 4\n    |--- snapdiff.log\n\n```\n**serialized_diff**\u003cbr/\u003e\n\nserialized_diff is a file, which contains diff between the two snapshots. The\ndiff operations listed in the file are required to be applied in sequential\norder. The example of the output is mentioned below.\n\n**parallel_diff**\u003cbr/\u003e\n\nparallel_diff is a directory, which contains a number of files with numerical\nname. These files must be processed in ascending order. However, operations in\na file are independent and can be applied in parallel. Using parallel diff can\nresult in significantly reduce backup time.\n\n**serialized_json**\u003cbr/\u003e\n\nserialized_json is a directory, which contains the serialized diff in json\nformat. It is chunked into groups of 1000 diffs, starting from `0.json`, and\nspills over to `1.json`, etc. In addition to the basic serialized_diff output,\nit contains information about the path, size, ctime, mtime,and atime of the\nfile. This is only generated when `generate json` param is true.\nBelow is an example output:\n\n_**Note about running on Windows: Windows reports the ctime, mtime, and atime\nonly in time_t format, which corresponds to the \"sec\" field in Unix. The \"nsec\"\nfield is thus left as 0 in the json output on Windows.**_\n\n**Example serialized_diff**\u003cbr/\u003e\n```\nDIR_C          .vdfs\nDIR_RENAME      a/b/c       .vdfs/22\nDIR_DELETE      a/b\nDIR_S           a\nDIR_CS          a/d\nFILE_MS         new/test.txt\nFILE_CMS        new/foo.txt\nFILE_DELETE     new/bar.txt\nDIR_RENAME     .vdfs/22  a/d/c\nDIR_S           a/d/c\nDIR_DELETE     .vdfs\n```\n\n**Example serialized_json/0.json**\u003cbr/\u003e\n```\n[{\n\"type\" : \"dir\",\n\"atime\" : { \"nsec\" : 723925300, \"sec\" : 1404894388 },\n\"ctime\" : { \"nsec\" : 43381506, \"sec\" : 1406022454 },\n\"mtime\" : { \"nsec\" : 723925300, \"sec\" : 1404894388},\n\"path\" : \"/dir_foo/dir_bar\",\n\"created\": true,\n\"modified\" : false,\n\"stat\": true,\n\"xattr\": false\n},\n{\n\"type\" : \"file\",\n\"atime\" : { \"nsec\" : 723925300, \"sec\" : 1404894388 },\n\"ctime\" : { \"nsec\" : 43381506, \"sec\" : 1406022454 },\n\"mtime\" : { \"nsec\" : 723925300, \"sec\" : 1404894388},\n\"path\" : \"/dir_foo/dir_bar/file_foo\",\n\"size\" : 470604,\n\"created\": true,\n\"modified\" : true,\n\"stat\": true,\n\"xattr\": false\n},\n{\n\"type\" : \"delete\",\n\"path\" : \"/dir_foo/file_bar\"\n},\n{\n\"type\" : \"rename\",\n\"path_old\" : \"/dir_foo/foo\",\n\"path_new\" : \"/dir_foo/dir_bar/new_foo\"\n}\n}]\n```\n\n**Prerequisite**\u003cbr/\u003e\n```\nmake\ng++\ng++-mingw-w64-x86-64\n```\n\n**Building**\u003cbr/\u003e\n```\nmake all\n```\n\n**Usage**\u003cbr/\u003e\n```\nLinux:\nCopy snapshot-diff to NFS client and run\nsnapshot-diff \u003csnapshot dir\u003e \u003csnap1\u003e \u003csnap2\u003e \u003cresult dir\u003e\n\nWindows:\nCopy snapshot-diff to Windows client and run\nsnapshot-diff.exe \u003csnapshot dir\u003e \u003csnap1\u003e \u003csnap2\u003e \u003cresult dir\u003e\n\n```\n**Developer Certificate of Origin**\u003cbr/\u003e\n\nBefore you start working with snapshot-diff-library, please read our Developer Certificate of Origin. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fsnapshot-diff-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware-archive%2Fsnapshot-diff-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fsnapshot-diff-library/lists"}