Skip to content

Instantly share code, notes, and snippets.

@ajthemacboy
Last active May 5, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajthemacboy/d4ee823a367d4e0ad01878900b72a9c4 to your computer and use it in GitHub Desktop.
Save ajthemacboy/d4ee823a367d4e0ad01878900b72a9c4 to your computer and use it in GitHub Desktop.
7zip batch ultra 7z compression
for file in $(find . -type f -name "hdd-0.vhdx.*"); do
7z a -t7z $file.7z $file -m0=lzma2 -mx=9 -ms=4G -mmt=8 -aoa
mv $file.7z "/mnt/d/Amazon Drive/migration/iMac_Image_2-28-17"
done
# Remove ~.~ directories after backup=t
for dir in $(find *~* -type d); do
rawdir=$(echo $dir | cut -d "." -f1)
mv --backup=t $dir/* $rawdir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment