PHPackages                             koyabu/mysqlbackup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. koyabu/mysqlbackup

ActiveLibrary[Database &amp; ORM](/categories/database)

koyabu/mysqlbackup
==================

v1.0.1.x-dev(3mo ago)011MITPHP

Since Dec 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/stievenk/koyabu-sqlbackup)[ Packagist](https://packagist.org/packages/koyabu/mysqlbackup)[ RSS](/packages/koyabu-mysqlbackup/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Install [![Latest Stable Version](https://camo.githubusercontent.com/19a40a854e8b43613dfa4a6febfe5cd28886234101ad69fbf69fc629443ee068/68747470733a2f2f706f7365722e707567782e6f72672f6b6f796162752f6d7973716c6261636b75702f646f776e6c6f616473)](https://camo.githubusercontent.com/19a40a854e8b43613dfa4a6febfe5cd28886234101ad69fbf69fc629443ee068/68747470733a2f2f706f7365722e707567782e6f72672f6b6f796162752f6d7973716c6261636b75702f646f776e6c6f616473)
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#install-)

```
composer require koyabu/mysqlbackup

```

Cron Job Example
----------------

[](#cron-job-example)

```
# Run Backup every day at 03:00 AM
0 3 * * * /usr/bin/php /home/myusername/sqlbackup.php > /dev/null 2>&1

```

Change log
----------

[](#change-log)

- METHOD $Backup-&gt;removeOldFile(10,true); not available on v1.0.1
- Sync to Dropbox ()
- Sync to Google Drive ()

Requirement
-----------

[](#requirement)

- MySQL with mysqldump set to Global
- PHP 8+ and composer
- PHP MySQLi enable
- Cron job or Task Scheduler
- bzip2 (optional, only if compress set = true)

### Feature

[](#feature)

- Backup Daily
- Backup Monthly
- Backup Weekly
- Backup All (with exeption filter)
- Save to Dropbox
- Save to Google Drive
- Auto Delete old file
- Don't remove file /your-backup-dir/gdrive.json if you sync to Google Drive it will create new folder if folder\_id not found in gdrive.json

### Sample Code

[](#sample-code)

```
