7z-archive.sh 269 B

123456789101112
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. display_help(){
  4. echo "Usage: ${0##*/} [file/s]"
  5. exit 2
  6. }
  7. [[ $# -lt 1 ]] && display_help
  8. date=$(date '+%Y-%m-%d_%H-%M-%S')
  9. 7z a -t7z -m0=lzma2 -mx=9 -aoa -mfb=64 -md=32m -ms=on "archive_${date}.7z" "$@"