Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patricknelson/db-backups
Quick script to perform mysql dumps which are retained temporarily.
https://github.com/patricknelson/db-backups
Last synced: 25 days ago
JSON representation
Quick script to perform mysql dumps which are retained temporarily.
- Host: GitHub
- URL: https://github.com/patricknelson/db-backups
- Owner: patricknelson
- License: mit
- Created: 2015-10-22T15:59:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-29T06:40:40.000Z (about 9 years ago)
- Last Synced: 2024-05-17T00:19:09.191Z (6 months ago)
- Language: PHP
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# db-backups
Quick and dirty script to perform mysql dumps which are retained temporarily.### Example Setup
**Note:** When running this script, it assumes that the user is executing this via shell and that they have a `.my.cnf` file setup to allow access to the `mysql` and `mysqldump` clients without a password.
To get started, modify the configuration in the top of the file to suit your needs, e.g.:
```php
// Total number of days that back-ups are kept.
// NOTE: This goes by filename only! Ex: database.2015-10-21.7am.sql.gz
$keepdays = 30;// Location to store backed-up database files (in sql.gz format).
// NOTE: Do not include trailing slashes. Must be FULL path.
$backupdir = __DIR__ . "/backups";// If messages should be output.
define("DEBUG", true);// Timezone setting.
date_default_timezone_set("America/New_York");
```In the `root` crontab, create the following entry:
```bash
0 12,18 * * * /usr/bin/php /root/db-backups.php &>/dev/null
```