Created
October 18, 2018 13:35
-
-
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.
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
# 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