Created
July 6, 2018 18:03
-
-
Save czers/43ee62b32ebd9d381ddfe59be637447e to your computer and use it in GitHub Desktop.
Assert safe removal of files - e.g. make sure that photos from SD card are all copied to your hard disk before deleting them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function get-checksums-with-names { | |
find $1 -type f -exec basename "{}" \; > $2.names | |
#find $1 -type f -exec md5sum "{}" \; > $2.fullpaths.md5sum | |
#cut -c-32 $2.fullpaths.md5sum > $2.just.md5sum | |
#paste -d '|' $2.just.md5sum $2.names > $2.names.md5sum | |
} | |
get-checksums-with-names $1 $2 | |
# compare with (example): sort Lumix.names 20172018.names 20172018.names | uniq -u | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment