Compare directories. Source (src) never modified, dst can be updated with -s/--sync
Project description
DeltaDir
Compare directories using various methods and optionally synchronize them.
Examples
Create test environment
# prepare two identical directories
mkdir -p /tmp/src/subdir
echo x > /tmp/src/test.txt
echo x > /tmp/src/subdir/test.txt
cp -a /tmp/src /tmp/dst
Find missing (new) files
The default mode is exists: a file is considered different if it is completely missing in the destination directory (dst/).
# create new file in src
echo new > /tmp/src/new.txt
# new file is found
deltadir /tmp/src/ /tmp/dst/
new.txt
# Let's synchronize it using -s or --sync! (no overwrite by default)
deltadir /tmp/src/ /tmp/dst/ --sync
new.txt
Find modified files
you can use -m/--method (exists, mtime, size, hash) for more accurate checking
# create new file in src
echo new content > /tmp/src/new.txt
# find nothing
deltadir /tmp/src/ /tmp/dst/
# use hash (slowest, but most reliable) and detect it
deltadir /tmp/src/ /tmp/dst/ -m hash
new.txt
# sync with overwrite
deltadir /tmp/src/ /tmp/dst/ -m hash -s --overwrite
new.txt
Always recursive
deltadir always work recursively.
echo new > /tmp/src/subdir/newfile.txt
deltadir /tmp/src/ /tmp/dst/
subdir/newfile.txt
See result as table
Add -t/--table to see results as table:
deltadir /tmp/src/ /tmp/dst/ -t
File | Reason | Src | Dst | Action
-----------------------------------------------------------------------------------------------------------------------------
subdir/newfile.txt | missing | - | - | nothing(reported)
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 deltadir-0.1.0.tar.gz.
File metadata
- Download URL: deltadir-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a143470ea197d941e7f95e8a22579d86c06a1517ddf1da4cde37049a94865750
|
|
| MD5 |
05bc43094ebf7eac475d2eff14d8be13
|
|
| BLAKE2b-256 |
37132fea5f7bb5114959a143e856daba984d011a0e1bd3df6e0f41d201e0e6ea
|
File details
Details for the file deltadir-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deltadir-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63679991ca8cb9c0c90bb14e3933cec0a066f345a7455e75edec65a3494e0585
|
|
| MD5 |
ff1872a76a42af483ac02de7c43dbc96
|
|
| BLAKE2b-256 |
6e3ffc503807195acde21c830a3894cd0121efcb9abd12ba9df6cf83344b4133
|