pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.91k stars 71 forks source link

The `--dry-run` output looks suspiciously like a usable shell script #90

Open th1000s opened 2 years ago

th1000s commented 2 years ago

The output of --dry-run for link and dedupe moves the original files out of the way via mv (just like fclones itself) but then completely ignores possible failure of the next command and removes the backup in the following step.

If the calling shell does not have errexit set this can lead to data loss (actually just filename loss) if the ln/cp fails.

I would suggest to just print the action for each line instead and optionally emit a shell header which is called and includes proper error handling.