Skip to content

Instantly share code, notes, and snippets.

View codePaolo's full-sized avatar

PV codePaolo

  • codePaolo
  • USA
View GitHub Profile
@Vigrond
Vigrond / jellyfinchromecast.md
Last active October 8, 2025 14:40
Jellyfin with Chromecast
@ashrafsharif
ashrafsharif / xtrabackup.sh
Created January 11, 2021 05:17
A bash script to create xtrabackup full and incremental backups using cron.
#!/bin/bash
# Create a full or incremental xtrabackup
# In the cron job, set it like below:
## xtrabackup weekly full backup (Saturday, 9 PM UTC == Sunday, 5 AM MYT)
## 0 21 * * 6 /root/backups/scripts/xtrabackup.sh full > /dev/null
## xtrabackup daily incremental backup (Sunday->Friday, 9 PM UTC == Monday->Saturday, 5 AM MYT)
## 0 21 * * 0-5 /root/backups/scripts/xtrabackup.sh incremental > /dev/null
# Note:
## - For every full backup taken, all created incremental backups will be deleted.
@bdwyertech
bdwyertech / xtrabackup_runner.sh
Created December 20, 2017 02:58 — forked from piotr-gbyliczek/xtrabackup_runner.sh
A fancier mysql backup script for Xtrabackup:
#!/bin/bash
# Script to create full and incremental backups (for all databases on server) using innobackupex from Percona.
# http://www.percona.com/doc/percona-xtrabackup/innobackupex/innobackupex_script.html
#
# (C)2017 Piotr Gbyliczek (p.gbyliczek at node4.co.uk)
# - changed to use build in compression mechanism
# - corrected restore process (restore from mixed compressed and uncompressed incrementals is supported as well)
# - tidied up script a bit and added new checks
# - removed unneeded xbstream usage (useful only for network transfers, not compatible with incremental backups)
@ssplatt
ssplatt / docker-compose.yml
Created September 27, 2017 02:06
docker - owncloud with letsencrypt, mariadb, and redis
owncloud:
image: owncloud
links:
- mariadb:mysql
- redis:redis
ports:
- 8081:80
volumes:
- /opt/docker-persist/owncloud/apps:/var/www/html/apps
- /opt/docker-persist/owncloud/config:/var/www/html/config
@widnyana
widnyana / galera-backup.sh
Created March 22, 2017 02:43
bash script to do a full backup & then incremental backups for galera cluster
#!/bin/bash
#: stolen from: https://github.com/sayajin101/Galera-Cluster-Percona-Backup
##############################################################################################
# Please install the following packages & repositories first #
# rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm #
# qpress.x86_64 rsync.x86_64 percona-xtrabackup.x86_64 #
##############################################################################################
[ $(which qpress > /dev/null 2>&1; echo ${?}) -ne 0 ] && { echo -e "\nqpress is required...exiting"; exit 1; };
@scottpnelson
scottpnelson / README.md
Last active June 3, 2024 14:07
Automatic MySQL database setup from .env file contents

About

This script will automatically create a new MySQL database for you by reading your MySQL database name, host name, and user credentials from your .env file. This allows you to keep your database details safe, in a single location. Ideal for deployment and security.

Installation

1. Download setup_mysql.sh to your project root directory 2. You can modify setup_mysql.sh to set the following: - ENV_FILE (the relative path to your .env file -- e.g. ENV_FILE="./.env.local") - DEFAULT_MYSQL_HOST (the host name of your MySQL server -- e.g. "localhost") - DEFAULT_MYSQL_ADMIN_USERNAME (the administrator username of your mysql server -- e.g. "root" (note: this is typically NOT the MySQL username of your app). This should be no longer than 16 characters. Some versions of MySQL allow for longer lengths. You can modify the MAX_MYSQL_USERNAME_LENGTH variable to change this length. - DEFAULT_MYSQL_ADMIN_PASSWORD (the administrator password of your mysql admin user -- e.g
@jaygooby
jaygooby / percona-xtrabackup.sh
Last active May 9, 2022 15:43
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@jmfederico
jmfederico / run-xtrabackup.sh
Last active December 18, 2024 14:39
Script to create full/incremental backups with xtrabackup.
#!/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`