Skip to content

Instantly share code, notes, and snippets.

@VxJasonxV
Last active January 30, 2021 23:18
Show Gist options
  • Save VxJasonxV/8a8708ffd31e61da4f591f6e9acba2f9 to your computer and use it in GitHub Desktop.
Save VxJasonxV/8a8708ffd31e61da4f591f6e9acba2f9 to your computer and use it in GitHub Desktop.
How to tame a mess of unnamed (and unextension named) files from Usenet, on a Synology NAS. Requires SABnzbd installed.
# For every file in a given directory
for x in *
do
if [ "`file $x |cut -d' ' -f 2-`" == "Parity Archive Volume Set" ] # If the file is determined to be a PAR file
then
# Print the filename and file type again as a confirmation
file $x
mv $x ${x}.par2 # Rename it to have a .par2 extension
fi
done
# For every now par2 file; scan every file that it might apply to, and (-p) delete PAR files after successful or non-necessary recovery
for x in *.par2 ; do /volume1/\@appstore/sabnzbd/bin/par2repair -p $x * ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment