Skip to content

Instantly share code, notes, and snippets.

View mehiel's full-sized avatar
💭
Plugged 🔌

Aggelos Karalias mehiel

💭
Plugged 🔌
View GitHub Profile
@mehiel
mehiel / export-partition.sh
Created May 30, 2020 15:46 — forked from borama/export-partition.sh
Shell script to export data from the given table partition and delete it aferwards
#!/bin/bash
# "panic button" when run in a for loop:
# exit
database="MY_DATABASE"
export_dir="/mnt/backups/my-archive"
set -e
@mehiel
mehiel / run_ghost.sh
Created May 30, 2020 15:46 — forked from borama/run_ghost.sh
Helper shell script for running the gh-ost tool
#!/bin/bash
function usage {
echo "Use ./run_ghost.sh table_name 'alter_command' [other_ghost_args]"
exit 1
}
database="MY_DATABASE_NAME"
table=$1
@mehiel
mehiel / autoarchive-tables.sh
Created May 30, 2020 15:45 — forked from borama/autoarchive-tables.sh
Shell script to automate MySQL tables time-based archival
#!/bin/bash
set -e
database="MY_DATABASE"
altered_tables=0
function fatal {
echo "FATAL: $1" >&2
echo "Exiting now." >&2