Created
December 3, 2018 08:44
-
-
Save WillieStevenson/021cccb7d4d05895f297ed054efac9b6 to your computer and use it in GitHub Desktop.
backup a path
This file contains 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/bash | |
## Tars up passed directory and uses multiple threads to do so. | |
usage() { | |
echo "This script takes three arguments." | |
echo "Usage: $ backup [src loc] [dest loc] [name]" | |
} | |
if [ "${1}" = "help" ]; then | |
usage | |
fi | |
cd $1 | |
tar -c --use-compress-program=pigz -f $2/$3-$(date +%Y_%m_%d_%H_%M_%S).tar.gz $1 | |
# tar -zcvf $2/$3-$(date +%m_%d_%Y_%H_%M_%S).tar.gz $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment