Skip to content

Instantly share code, notes, and snippets.

Avatar

Federico Jaramillo Martínez jmfederico

View GitHub Profile
@jmfederico
jmfederico / backups.sh
Last active Sep 24, 2015
MySQL quick commands!
View backups.sh
# BackUp
mysqldump --opt --password=miclave --user=miuser mibasededatos > archivo.sql
# BackUp to bz2
mysqldump --opt --password=miclave --user=miuser mibasededatos | bzip2 -c > archivo.sql.bz2
View keybase.md

Keybase proof

I hereby claim:

  • I am jmfederico on github.
  • I am jmfederico (https://keybase.io/jmfederico) on keybase.
  • I have a public key whose fingerprint is D443 BADA 5A61 E39F BCC3 FACC 7FFA 8033 0683 9014

To claim this, I am signing this object:

@jmfederico
jmfederico / Makefile
Last active Jul 10, 2020
An awsome Makefile
View Makefile
# On OSX the PATH variable isn't exported unless "SHELL" is also set, see: http://stackoverflow.com/a/25506676
SHELL = /bin/zsh
.DEFAULT_GOAL := help
TMPDIR := $(shell mktemp -d)
include .env
INTRO = "\n\e[33m------------------------------\e[32m\n$@\n\e[33m------------------------------\e[39m\n"
help: ## Prints this message
@jmfederico
jmfederico / run-xtrabackup.sh
Last active Nov 16, 2022
Script to create full/incremental backups with xtrabackup.
View run-xtrabackup.sh
#!/bin/sh
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}"
BACKDIR=/srv/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds
KEEP=1 # Number of additional backups cycles a backup should kept for.
START=`date +%s`