Last active
January 28, 2022 16:46
-
-
Save ThomasDalla/e28755571b2343cd35e0d8e8835cfe2a to your computer and use it in GitHub Desktop.
7z a folder into 1GB pieces adding md5 checksum
This file contains hidden or 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/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