Created
August 14, 2018 08:41
-
-
Save phamquocbuu/47de1666ce64ac5545cc07d01f77ad68 to your computer and use it in GitHub Desktop.
GUnzip and import latest database file
This file contains hidden or 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
| find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | xargs gunzip ; | |
| find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | perl -pe 'chomp' | xargs cat | mysql -u DB_USER DB_NAME ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment