Skip to content

Instantly share code, notes, and snippets.

@turbopixel
Last active September 26, 2016 20:53
Show Gist options
  • Select an option

  • Save turbopixel/be6e9199462b4d107ab8b36a709239f3 to your computer and use it in GitHub Desktop.

Select an option

Save turbopixel/be6e9199462b4d107ab8b36a709239f3 to your computer and use it in GitHub Desktop.

Revisions

  1. turbopixel revised this gist Sep 26, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion mysqldumper.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #!/bin/bash

    # MySQL Console Dumper
    # author: Nico Hemkes <www.nokes.de>
    # date: 26.09.2016
  2. turbopixel revised this gist Sep 26, 2016. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions mysqldumper.sh
    Original file line number Diff line number Diff line change
    @@ -12,11 +12,12 @@ today=$(date +"%m-%d-%Y")
    filename="mysql_dump-$today.sql.gz"

    # output start
    printf "\n= = = MySQL Console Dumper = = =\n"
    printf "\nstarting ...\n"
    printf "\n= = = MySQL Console Dumper = = ="
    printf "\nstarting ...\n\n"

    # dump
    mysqldump -u"$user" -p"$pw" -Q --events --ignore-table=mysql.event --all-databases | gzip -9 > $backupDir$filename

    # output end
    printf "\ndone!\n\n"
    printf "Backup placed at $backupDir$filename\n\n"
    printf "done!\n"
  3. turbopixel revised this gist Sep 26, 2016. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions mysqldumper.sh
    Original file line number Diff line number Diff line change
    @@ -4,17 +4,19 @@
    # author: Nico Hemkes <www.nokes.de>
    # date: 26.09.2016

    user="USERNAME"
    # settings
    user="USER"
    pw="PASSWORD"
    backupDir="/root/backup"
    filename=$(date +"%m_%d_%Y")
    backupDir="/media/backup/"
    today=$(date +"%m-%d-%Y")
    filename="mysql_dump-$today.sql.gz"

    echo "+++ MySQL Console Dumper +++"
    echo ""
    echo "start..."
    echo ""
    # output start
    printf "\n= = = MySQL Console Dumper = = =\n"
    printf "\nstarting ...\n"

    mysqldump -u"$user" -p"$pw" -Q --events --ignore-table=mysql.event --all-databases | gzip -9 > $backupDir/Database-$filename.sql.gz
    # dump
    mysqldump -u"$user" -p"$pw" -Q --events --ignore-table=mysql.event --all-databases | gzip -9 > $backupDir$filename

    echo "... done!"
    echo ""
    # output end
    printf "\ndone!\n\n"
  4. turbopixel created this gist Sep 26, 2016.
    20 changes: 20 additions & 0 deletions mysqldumper.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/bash

    # MySQL Console Dumper
    # author: Nico Hemkes <www.nokes.de>
    # date: 26.09.2016

    user="USERNAME"
    pw="PASSWORD"
    backupDir="/root/backup"
    filename=$(date +"%m_%d_%Y")

    echo "+++ MySQL Console Dumper +++"
    echo ""
    echo "start..."
    echo ""

    mysqldump -u"$user" -p"$pw" -Q --events --ignore-table=mysql.event --all-databases | gzip -9 > $backupDir/Database-$filename.sql.gz

    echo "... done!"
    echo ""