Skip to content

Instantly share code, notes, and snippets.

@WillieStevenson
Created December 3, 2018 08:44
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 WillieStevenson/021cccb7d4d05895f297ed054efac9b6 to your computer and use it in GitHub Desktop.
Save WillieStevenson/021cccb7d4d05895f297ed054efac9b6 to your computer and use it in GitHub Desktop.
backup a path
#!/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