Skip to content

Instantly share code, notes, and snippets.

@JustinMcNamara74
Last active July 28, 2017 14:37
Show Gist options
  • Save JustinMcNamara74/af14565af0aa5cc966fa to your computer and use it in GitHub Desktop.
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.
#!/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