Skip to content

Instantly share code, notes, and snippets.

@jorovipe97
Created October 18, 2018 13:35
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 jorovipe97/e26cddddc9e42b95ad5596fc85f22837 to your computer and use it in GitHub Desktop.
Save jorovipe97/e26cddddc9e42b95ad5596fc85f22837 to your computer and use it in GitHub Desktop.
A simple zipper command with custom name, ideal for make simple backups in unix systems.
# Author: Jose Romualdo Villalobos Perez
# Date: 18 oct, 2018
# Shell is white-space sensitive in many places, inluding = operator
# var = foo throw error
# var=foo is fine
dirName=$1
DATE=`date '+%Y-%m-%d-%H-%M-%S'`
zipFile="$dirName-$DATE.zip"
zip -r $zipFile $dirName
echo "\nFolder zipped into: $zipFile"
echo "Full path: $PWD/$zipFile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment