Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to generate list of unique files #161

Closed
SeeSpotRun opened this issue Nov 1, 2015 · 2 comments
Closed

Option to generate list of unique files #161

SeeSpotRun opened this issue Nov 1, 2015 · 2 comments

Comments

@SeeSpotRun
Copy link
Collaborator

In response to http://askubuntu.com/questions/686763/how-do-i-view-non-matching-files-only-in-fdupes; working first attempt at https://github.com/SeeSpotRun/rmlint/tree/feature/uniques. Usage: rmlint -o uniques ...

I think it could be quite handy, eg for recovering just the unique files from an old backup:
$ rmlint -o uniques -k ~ // /mnt/backup

Discussion welcome, including best way to copy the found files (short shell script I guess).

@SeeSpotRun
Copy link
Collaborator Author

Here's a simulated usecase using rsync to recover unique files from an old backup:

$ # make some files
$ mkdir originals && cd originals
$ for i in {1..200}; do dd if=/dev/urandom bs=1 count=${#i} of="file $i"; done
...
$ # make a backup
$ cd .. && cp -a originals backup
...
$ # make some changes (add some, change some, delete some)
$ cd originals
$ for i in {200..300}; do dd if=/dev/urandom bs=1 count=${#i} of="file $i"; done
$ for i in {99..110}; do dd if=/dev/urandom bs=1 count=${#i} of="file $i"; done
$ for i in {9..20}; do rm "file $i"; done
$ cd ..
...
$ # use rmlint to find unique files in the backup
$ rmlint -o uniques -k originals/ // backup/ | tee uniques.txt
...
$ # use rsync to archive the unique files
$ mkdir recovered
$ rsync -av --files-from=uniques.txt / recovered/ 
...
$ # did it work?
$ tree recovered/
...
$ # great, now we can wipe the backup drive
$ rm -rf backup

@sahib
Copy link
Owner

sahib commented Nov 9, 2015

I merged this feature to develop, closing therefore.

@sahib sahib closed this as completed Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants