Created
January 3, 2019 21:41
-
-
Save zilahir/80cd41a53bc14fcacbcc076f96d64d61 to your computer and use it in GitHub Desktop.
pre-commit
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
#!/usr/bin/env bash | |
current_date=`date +%Y_%m_%d_%H_%M`; | |
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump | |
mkdir -p "$current_date"; | |
mysqldump --net_buffer_length="83000" -u wp_user -pwp_password -h 0.0.0.0 -P 32770 --skip-extended-insert wordpress > /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date"/"$current_date".sql | |
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date"; | |
echo "adding new sql file to repo" | |
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/ | |
git add /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date"/"$current_date".sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe change:
/Users/richardzilahi/
to~/
;)