Created
February 3, 2021 11:52
-
-
Save Xeckt/6d7b210bc6887e0daf523fee41bd490b to your computer and use it in GitHub Desktop.
Bash backup
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
function backup_files() { | |
_backup_file="template-backup-["`date +"%Y-%m-%d-%m"`"].tar.gz" | |
echo 'Creating backup of:' $(pwd) | |
tar -czf $HOME/$_backup_file . &>> install/install.log | |
if [ $? -eq 0 ]; then | |
echo 'Backup seems to be successful.' | |
else | |
echo 'Something went wrong, exit code:' $? | |
echo 'Check ....' | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment