Check the completeness of an rsync operation.
Project description
🏠Home • 🎇Features • 🔨Installation • 🚜Usage • 💻CLI • 💡Examples
🤖Jinja2 API • ✅Requirements • 🐳Docker • 🚸Gotchas
❔ What
Check the progress of a long running rsync operation, by hashing chunks of the files.
🎇 Features
- Can use any {md5sum/xxhash}-compatible CLI to hash the files.
- 🐳🌊🖥️ Docker Image (See README: Docker Image).
🔨 Installation
# Install from pypi (https://pypi.org/project/rsynccheck/)
pip install rsynccheck
# Install from git (https://github.com/realazthat/rsynccheck)
pip install git+https://github.com/realazthat/rsynccheck.git@v0.1.0
🚜 Usage
Example:
# Generate the audit.yaml file.
python -m rsynccheck.cli \
hash \
--ignorefile ".gitignore" \
--ignoreline .trunk --ignoreline .git \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--chunk-size "${CHUNK_SIZE}" \
--directory "${SRC_DIRECTORY}"
# Check the audit.yaml file on the other machine.
python -m rsynccheck.cli \
audit \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--output-format table \
--mismatch-exit 0 \
--directory "${DST_DIRECTORY}"
Screenshot in terminal:
💻 Command Line Options
✅ Requirements
- Linux-like environment
- Why: Uses pexpect.spawn().
- Python 3.8+
- Why: Some dev dependencies require Python 3.8+.
Tested Platforms
- WSL2 Ubuntu 20.04, Python
3.8.0. - Ubuntu 20.04, Python
3.8.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, tested in GitHub Actions workflow (build-and-test.yml).
🐳 Docker Image
Docker images are published to ghcr.io/realazthat/rsynccheck at each tag.
NOTE: You can't use a custom hashing command with the Docker image, because it isn't available inside the container. xxhash is installed in the image.
# Use the published images at ghcr.io/realazthat/rsynccheck.
# Generate the audit.yaml file.
# /data in the docker image is the working directory, so paths are simpler.
docker run --rm --tty \
-v "${PWD}:/data" \
ghcr.io/realazthat/rsynccheck:v0.1.0 \
hash \
--ignorefile ".gitignore" \
--ignoreline .trunk --ignoreline .git \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--chunk-size "${CHUNK_SIZE}" \
--directory "${SRC_DIRECTORY}"
# Check the audit.yaml file on the other machine.
docker run --rm --tty \
-v "${PWD}:/data" \
ghcr.io/realazthat/rsynccheck:v0.1.0 \
audit \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--output-format table \
--mismatch-exit 0 \
--directory "${DST_DIRECTORY}"
If you want to build the image yourself, you can use the Dockerfile in the repository.
docker build -t my-rsynccheck-image .
# Generate the audit.yaml file.
# /data in the docker image is the working directory, so paths are simpler.
docker run --rm --tty \
-v "${PWD}:/data" \
my-rsynccheck-image \
hash \
--ignorefile ".gitignore" \
--ignoreline .trunk --ignoreline .git \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--chunk-size "${CHUNK_SIZE}" \
--directory "${SRC_DIRECTORY}"
# Check the audit.yaml file on the other machine.
docker run --rm --tty \
-v "${PWD}:/data" \
my-rsynccheck-image \
audit \
--audit-file ".deleteme/check-changes-audit.yaml" \
--progress none \
--output-format table \
--mismatch-exit 0 \
--directory "${DST_DIRECTORY}"
🤏 Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
🔑 License
This project is licensed under the MIT License - see the ./LICENSE.md file for details.
🙏 Thanks
- Colorful CLI help: hamdanal/rich-argparse.
- pathspec, for gitignore support: cpburnz/python-pathspec.
- humanize: jmoiron/humanize.
- xxhash: Cyan4973/xxHash.
- pydantic: pydantic/pydantic.
🤝 Related Projects
Not complete, and not necessarily up to date. Make a PR (contributions) to insert/modify.
| Project | Stars | Last Update | Language | Platform | Similarity X Obviousness |
|---|---|---|---|---|---|
| RsyncProject/rsync | 2.4k | 2024/05/28 |
C | CLI | ⭐⭐⭐ |
🫡 Contributions
Development environment: Linux-like
-
For running
pre.sh(Linux-like environment).-
From ./.github/dependencies.yml, which is used for the GH Action to do a fresh install of everything:
bash: scripts. findutils: scripts. grep: tests. xxd: tests. git: scripts, tests. xxhash: scripts (changeguard). rsync: out-of-directory test. expect: for `unbuffer`, useful to grab and compare ansi color symbols. jq: dependency for [yq](https://github.com/kislyuk/yq), which is used to generate the README; the README generator needs to use `tomlq` (which is a part of `yq`) to query `pyproject.toml`. unzip: scripts (pyenv). curl: scripts (pyenv). git-core: scripts (pyenv). gcc: scripts (pyenv). make: scripts (pyenv). zlib1g-dev: scripts (pyenv). libbz2-dev: scripts (pyenv). libreadline-dev: scripts (pyenv). libsqlite3-dev: scripts (pyenv). libssl-dev: scripts (pyenv). libffi-dev: bdist_wheel (otherwise `pip install .` fails). If installing pyenv, this must be installed _first_.
-
Requires
pyenv, or an exact matching version of python as in ./.python-version (which is currently3.8.0). -
act (to run the GH Action locally):
- Requires nodejs.
- Requires Go.
- docker.
-
Generate animation:
- docker
-
docker (for building the docker image).
-
Commit Process
- (Optionally) Fork the
developbranch. - Stage your files:
git add path/to/file.py. bash ./scripts/pre.sh, this will format, lint, and test the code.git statuscheck if anything changed (generated ./README.md for example), if so,git addthe changes, and go back to the previous step.git commit -m "...".- Make a PR to
develop(or push to develop if you have the rights).
🔄🚀 Release Process
These instructions are for maintainers of the project.
- In the
developbranch, runbash ./scripts/pre.shto ensure everything is in order. - In the
developbranch, bump the version in ./pyproject.toml, following semantic versioning principles. Also modify thelast_releaseandlast_stable_releasein the[tool.rsynccheck-project-metadata]table as appropriate. Runbash ./scripts/pre.shto ensure everything is in order. - In the
developbranch, commit these changes with a message like"Prepare release X.Y.Z". (See the contributions section above). - Merge the
developbranch into themasterbranch:git checkout master && git merge develop --no-ff. masterbranch: Tag the release: Create a git tag for the release withgit tag -a vX.Y.Z -m "Version X.Y.Z".- Publish to PyPI: Publish the release to PyPI with
bash ./scripts/deploy-to-pypi.sh. - Push to GitHub: Push the commit and tags to GitHub with
git push && git push --tags. - The
--no-ffoption adds a commit to the master branch for the merge, so refork the develop branch from the master branch:git checkout develop && git merge master. - Push the develop branch to GitHub:
git push origin develop.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rsynccheck-0.1.0.tar.gz.
File metadata
- Download URL: rsynccheck-0.1.0.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5ee10ec66b9e6f7f5b5194da10fef0a89f67518922135d2b9ecef081ec4f0af
|
|
| MD5 |
258fd0cae2c9451bd69398ef90cae8bf
|
|
| BLAKE2b-256 |
14a9e76673b3599f614790874e4aaa8c4c0a6cf5b430d8de7105cf2cc0e36842
|
File details
Details for the file rsynccheck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rsynccheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98385cf55f133a44490fc387a380b3fdbba38e8e101075472dd3ae60fce5345a
|
|
| MD5 |
8a8a939c57bf2f85c6980d2fcd651583
|
|
| BLAKE2b-256 |
d94b261b6ccae641b91dca30a6d9454ac87c978c4930dbe2a757cb195ef17478
|