Commit Graph

5 Commits

Author SHA1 Message Date
Colin Hebert
b788358600
Support Hardlinks (Any number) - Update (#70)
* Support hardlink groups, add debug

-Adds debug functionality with extended details
-Supports detecting inode groups for hardlink processing.
-Pulls files and sorts by, then groups by inode group with awk
-Checks all files in an inode group's counts when calculating skipping counts
-Removes existing skip hardlink flag
-Removes hardlinks and recreates them directly after the balance copy/delete/move operation per inode group to minimize 'downtime'

* Update README.md to denote hardlink support

Adds details around the debug flag, hardlink support, removed --skip-hardlinks functionality, and temporary files used during the script processing.

* Add additional hardlink group database notes

* typo

* Flip default debug

* Fix space handling in paths

* Fix echo bug

Removed the 'recreating hardlinks' echo for inode groups of 1 file.

* Introduce echo_debug

* Reintroduce cp documentation

* Remove unnecessary -e flag

* Remove unused flag

* Fix broken test due to | in the filename

* Add ignore on temporary inode files

* Update tests to assert the hardlinks are still working

* Fix ShellCheck issues

* Fix pasting issue

* Make grep compatible with BSD/MacOS

* Print whole line in debug

* Fix stat for BSD

* Fix stat for BSD part 2

* Fix shellcheck entry

* Fix stats working with FreeBSD

* Use bash's double brackets for consistency sake

* Expand to a string

---------

Co-authored-by: undaunt <31376520+undaunt@users.noreply.github.com>
2025-04-15 21:12:22 +02:00
meo
d190faf49c
Expand test (#59)
* add(ignore): ignore of .vscode file

add the vscode config file to gitignore

* add(test): add set of test

- test 1000 1Ko file
- test 5 1 Go file
- test whit both

* fix: spellcheck

prevent wordspliting

* fix: remove of db

remove the db before testing for more accurate time

* fix: time in macOS and freeBSD

- use of gdate (coreutils) for macOS
- switch to `ns` in place of `ms` for freeBSD
2025-01-17 22:50:33 +01:00
meo
bd8d447150
Test mac os (#53)
* add: test on MacOS

Add test for MacOS in Github action

Maybe see this to add test for FreeBSD :
https://github.com/marketplace/actions/freebsd-vm

* add: log to test

adding log to the test for better understanding

* fix: shellcheck

remove the yellow color that is unused in the test

* fix: fail on lower-casting

the `"${variable,,}"` seam to not work on macOS so y remove it for the `skip_hardlink_flag` because it's always lowercase

* fix: macOS

remove all the lower-case casting

* fix(perf): going to `stat` remove `lsattr` macOS

The command `lsattr` is not supported on macOS so I have remove it
switch to `stat` instead of `ls` for better performance and no subshell
use of parameter expansion with  `%` in place of `awk` for performance and no subshell

* fix: forgot to remove variable
2024-12-17 00:33:35 +01:00
johnpyp
973855c049
--skip-hardlinks flag (#22)
* feat: --skip-hardlinks flag

Adds a --skip-hardlinks flag that will not process any files that have an active hardlink.

Without a pre-scan to identify hardlink targets and relink them after copies, all this would result in is duplication.
You'd then have to run another de-duplicator, which doesn't have knowledge of the balancing, and could arbitrarily undo
the balancing work.

* doc: .rebalance suffix -> .balance suffix

* doc: add --skip-hardlinks parameter to README

* test: add unit tests for --skip-hardlink
2023-06-16 16:36:43 +02:00
Markus Ressel
d62e6e0be7
added folder structure for testing (#7)
* added folder structure for testing
added testing.sh script
added testing github action

* delete rebalancing file for testing

* run multiple variants of the command

* fix "integer expression expected"

* added assertions

* output logged data
2022-03-29 04:02:13 +02:00