User Tools

Site Tools


scripting:mariadb-backup.sh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:mariadb-backup.sh [2015-03-09 01:23] – adding link to latest gabrielscripting:mariadb-backup.sh [2019-08-10 17:26] (current) – linked to https://gitlab.com/unxis/mariadb-backup.sh gabriel
Line 1: Line 1:
-====== mariadb-backup.sh - a simple script to dump and rotate MariaDB backups  ======+====== mariadb-backup.sh ======
  
-This script is useful to dump a MariaDB (or MySQL) database to disk and to rotate through a given number of backups.  It supports two command line arguments:+//This script has moved to [[https://gitlab.com/unxis/mariadb-backup.sh|GitLab]] and is no longer updated on the wiki.// 
 + 
 +This script can be used to dump a MariaDB (or MySQL) database to disk and to rotate through a given number of backups.  It supports two command line arguments:
  
   * **-q** run silently (for use in crontabs or other non-interactive settings)   * **-q** run silently (for use in crontabs or other non-interactive settings)
   * **-k N** number of recent backups to keep (default is 7)   * **-k N** number of recent backups to keep (default is 7)
  
-The script assumes that backup user has a ''~/.my.cnf'' file storing the database connection (or passwordless access to the database as the current userid).+The script assumes that backup user has a ''~/.my.cnf'' file storing the database connection (or passwordless access to the database as the current userid).  It's a good idea to create a MariaDB user that has the appropriate permissions for dumping databases instead of running this script as the unix root user.
  
 <code bash> <code bash>
Line 13: Line 15:
 # mariadb-backup.sh - a simple script to dump and rotate MariaDB backups # mariadb-backup.sh - a simple script to dump and rotate MariaDB backups
 # #
-# Copyright (c) 2011 Gabriel M. O'Brien+# Copyright (c) 2015 Gabriel M. O'Brien
 # #
 # Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
scripting/mariadb-backup.sh.1425878599.txt.gz · Last modified: 2015-03-09 01:23 by gabriel