Last active
July 28, 2017 14:37
-
-
Save JustinMcNamara74/af14565af0aa5cc966fa to your computer and use it in GitHub Desktop.
#Bash Backup all shell scripts in a specific directory, to a destination directory.
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 | |
DATE=`date "+%y-%m-%d_%H:%M:%S"` | |
TOPATH=/to/file/path | |
FROMPATH=/from/file/path | |
#Backup all shell script files in FROMPATH and put them in TOPATH | |
/bin/find $FROMPATH -type f -name '*.sh' -print0 | tar zcf $FILEPATH/scripts_backup_$DATE.tar.gz --null -T - | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment