https://github.com/anmol-singh-jaggi/directory-snapshot
:file_folder: :floppy_disk: A tool to create a snapshot ( poor man's backup ) of a directory.
https://github.com/anmol-singh-jaggi/directory-snapshot
backup directory-snapshot directory-tree file treeview
Last synced: about 1 year ago
JSON representation
:file_folder: :floppy_disk: A tool to create a snapshot ( poor man's backup ) of a directory.
- Host: GitHub
- URL: https://github.com/anmol-singh-jaggi/directory-snapshot
- Owner: Anmol-Singh-Jaggi
- License: mit
- Created: 2015-03-25T15:10:04.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T10:51:26.000Z (almost 4 years ago)
- Last Synced: 2025-04-14T10:05:58.109Z (about 1 year ago)
- Topics: backup, directory-snapshot, directory-tree, file, treeview
- Language: Python
- Homepage:
- Size: 1.2 MB
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Directory Snapshot


[](https://saythanks.io/to/Anmol-Singh-Jaggi)
- A recursive directory listing program that produces a set of interlinked HTML files, structured in the same form as the input directory.
- Rather than taking a backup of the **contents** of a directory; instead it just stores the **metadata** (name, size etc.) of all the contents in a directory.
- It can be useful when you do not have enough space for a full backup, and your data consists of files which could be obtained easily again from another source after a disk failure (for example, software installation files).
*It can be thought of as a hyperlinked version of the [`dir /s`][1] or [`tree /f`][2] commands.*
## Installation
- Requires Python 3.7+.
- `pip install tqdm` (Required only if you want progress bar functionality).
## Usage
```
main.py [-h] [-dry] [-no-bar] [-no-hid] [-no-sym] [-max-rec MAX_RECURSION_DEPTH] src-path dest-path
positional arguments:
src-path The path of the source directory.
dest-path The path of the destination directory.
optional arguments:
-h, --help Show this help message and exit
-dry, --dry-run Just estimate the size of source directory and exit.
-no-bar, --hide-progress-bar
Whether to hide the progress bar or not (default
dont hide); will be silently ignored if "tqdm" package not
found.
-no-hid, --ignore-hidden
Whether to ignore hidden files and directories or not
(default not ignored).
-no-sym, --ignore-symlinks
Whether to ignore symlinks or not (default not ignored).
-max-rec MAX_RECURSION_DEPTH, --max-recursion-depth MAX_RECURSION_DEPTH
Maximum recursion depth (default infinite).
```
- Example:
`python3 main.py /Users/ajaggi/projects /Users/ajaggi/Desktop/snapshots --ignore-symlinks -no-hid -max-rec=5`
## To-Do
- Debug progress bar populating way too soon for projects dir.
- Add demo.
- Publish to pypi.
- Add test cases (especially edge cases like permission errors etc).
- Add code coverage.
- Setup `tox` and `Travis CI`.
- Add benchmarks.
- Add GUI.
- Explore parallel processing (Will have to use BFS instead of DFS probably).
- ~~Implement `dry-run` option.~~
- ~~Implement `no-hid` option.~~
- ~~Implement `no-sym` option.~~
- ~~Implement `max-rec` option.~~
- ~~Use `logging` module instead of `print` statements.~~
- ~~Log full exception stacktrace rather than just the message.~~
[1]:https://technet.microsoft.com/en-in/library/cc755121.aspx
[2]:https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/tree.mspx?mfr=true