Par2

par2 create -r100 basename.ext.par2 files1 files2 etc
# r = recovery %
# fXX = create more blocks starting from block XX

Creating an md5 sub file in each folder which doesn’t allready have one(with absolute paths):

find "$PWD" -type d | sort | while read dir; do [ ! -f "${dir}"/@md5Sum.md5 ] && echo "Processing " "${dir}" || echo "Skipped " "${dir}" " @md5Sum.md5 allready present" ; [ ! -f "${dir}"/@md5Sum.md5 ] &&  md5sum "${dir}"/* > "${dir}"/@md5Sum.md5 ; chmod a=r "${dir}"/@md5Sum.md5;done 

Creating an md5 sub file in each folder which doesn’t allready have one(no paths only filenames):

find "$PWD" -type d | sort | while read dir; do cd "${dir}"; [ ! -f @md5Sum.md5 ] && echo "Processing " "${dir}" || echo "Skipped " "${dir}" " @md5Sum.md5 allready present" ; [ ! -f @md5Sum.md5 ] &&  md5sum * > @md5Sum.md5 ; chmod a=r "${dir}"/@md5Sum.md5 ;done 

What differs between 1 and 2 is the way the files are presented in the resultig md5 file.

THe command string does the following:

Build a list of directory names for the current folder. (Tree) Sort the folder list. Check in each directory if the file @md5sum.md5 exists. Output Skipped if it exists. Output Processing if it doesn’t exist. If the @md5Sum.md5 file doesn’t exist. md5Sum will generate one with the checksums of all the files in the folder. 5) Set the generated @md5Sum.md5 file to read only. The output of this entire script can be redirected to a file (…..;done > test.log) or piped to another prog (like grep). The output wil howver only tell you which directories where Skiped and which have been Processed.

http://askubuntu.com/questions/318530/generate-md5-checksum-for-all-files-in-a-directory


Last modified: Tue May 14 08:43:34 2024