Skip to content

Instantly share code, notes, and snippets.

@ThomasDalla
Last active January 28, 2022 16:46
Show Gist options
  • Select an option

  • Save ThomasDalla/e28755571b2343cd35e0d8e8835cfe2a to your computer and use it in GitHub Desktop.

Select an option

Save ThomasDalla/e28755571b2343cd35e0d8e8835cfe2a to your computer and use it in GitHub Desktop.
7z a folder into 1GB pieces adding md5 checksum
#!/bin/sh
if [ -z "$1" ]; then
echo "Need to pass the folder to process (year)"
elif [ ! -d "$1" ]; then
echo "Invalid folder: $1"
else
echo "Processing $1"
echo "Zipping..."
DOSSIER=$1
7za a -xr@${HOME}/exclude.txt -m0=Copy -v1000M $DOSSIER.7z $DOSSIER
echo "Computing md5sum"
md5sum $DOSSIER.7z* > $DOSSIER.7z.md5
echo "Done!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment