Skip to content

Instantly share code, notes, and snippets.

@agoalofalife
Last active October 27, 2017 19:48
Show Gist options
  • Save agoalofalife/4b893f7314442108a17d5efba5d8e2da to your computer and use it in GitHub Desktop.
Save agoalofalife/4b893f7314442108a17d5efba5d8e2da to your computer and use it in GitHub Desktop.
List commands bash, which help me in work and studies
// dump mysql with date and gzip master!
mysqldump -u root -p databasename | gzip > `date '+%m-%y-%d %H:%M:%S'`.databasename.sql.gz
// dump mysql with date and gzip master from remote server
ssh [email protected] "mysqldump -u username -p basename | gzip > ./`date '+%m-%y-%d-%H:%M:%S'`.basename.sql.gz"
// with ignore table
ssh [email protected] "mysqldump -u username -p basename --ignore-table=database.table1" | gzip > ./`date '+%m-%y-%d-%H:%M:%S'`.basename.sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment