masonite-backup


Namemasonite-backup JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/py-package/masonite-backup
SummaryBackup solution for Masonite.
upload_time2022-12-31 03:44:43
maintainer
docs_urlNone
authorYubaraj Shrestha
requires_python
licenseMIT license
keywords masonite python development
VCS
bugtrack_url
requirements masonite masonite-orm
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<img src="https://banners.beyondco.de/Masonite%20Backup.png?theme=light&packageManager=pip+install&packageName=masonite-backup&pattern=charlieBrown&style=style_2&description=Backup+solution+for+Masonite+Apps.&md=1&showWatermark=1&fontSize=100px&images=adjustments&widths=50&heights=50">
</p>

<p align="center">
  <a href="https://docs.masoniteproject.com">
    <img alt="Masonite Package" src="https://img.shields.io/static/v1?label=Masonite&message=package&labelColor=grey&color=blue&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAA6gAwAEAAAAAQAAAA4AAAAATspU+QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAnxJREFUKBVNUl1IVEEUPjPObdd1VdxWM0rMIl3bzbVWLSofVm3th0AhMakHHyqRiNSHEAq5b2HSVvoQRUiEECQUQkkPbRslRGigG8auoon2oPSjpev+3PWeZq7eaC5nDt93vplz5txDQJYpNxX4st4JFiwj9aCqmswUFQNS/A2YskrZJPYefkECC2GhQwAqvLYybwXrwBvq8HSNOXRO92+aH7nW8vc/wS2Z9TqneYt2KHjlf9Iv+43wFJMExzO0YE5OKe60N+AOW6OmE+WJTBrg23jjzWxMBauOlfyycsV24F+cH+zAXYUOGl+DaiDxfl245/W9OnVrSY+O2eqPkyz4sVvHoKp9gOihf5KoAVv3hkQgbj/ihG9fI3RixKcUVx7lJVaEc0vnyf2FFll+ny80ZHZiGhIKowWJBCEAKr+FSuNDLt+lxybSF51lo74arqs113dOZqwsptxNs5bwi7Q3q8npSC2AWmvjTncZf1l61e5DEizNn5mtufpsqk5+CZTuq00sP1wkNPv8jeEikVVlJso+GEwRtNs3QeBt2YP2V2ZI3Tx0e+7T89zK5tNASOLEytJAryGtkLc2PcBM5byyUWYkMQpMioYcDcchC6xN220Iv36Ot8pV0454RHLEwmmD7UWfIdX0zq3GjMPG5NKBtv5qiPEPekK2U51j1451BZoc3i+1ohSQ/UzzG5uYFFn2mwVUnO4O3JblXA91T51l3pB3QweDl7sNXMyEjbguSjrPcQNmwDkNc8CbCvDd0+xCC7RFi9wFulD3mJeXqxQevB4prrqgc0TmQ85NG/K43e2UwnMVAJIEBNfWRYR3HfnvivrIzMyo4Hgy+hfscvLo53jItAAAAABJRU5ErkJggg==">
  </a>
  <img alt="GitHub Workflow Status (branch)" src="https://github.com/py-package/masonite-backup/actions/workflows/pythonapp.yml/badge.svg">
  <img alt="PyPI" src="https://img.shields.io/pypi/v/masonite-backup">
  <img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python Version">
  <img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/py-package/masonite-backup?include_prereleases">
  <img alt="License" src="https://img.shields.io/github/license/py-package/masonite-backup">
  <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

# Masonite Backup

Backup solution for Masonite.

### Features

- [x] Backup Database
- [x] Backup Files
- [x] Store Backup Locally in the filesystem
- [x] Email Backup
- [x] Store Backup in other Masonite Supported Storage Drivers [s3]


### Installation

```bash
pip install masonite-backup
```

### Configuration

Add BackupProvider to your project in `config/providers.py`:

```python
# config/providers.py
# ...
from backup import BackupProvider

# ...
PROVIDERS = [
    # ...
    # Third Party Providers
    BackupProvider,
    # ...
]
```

Then you can publish the package resources (if needed) by doing:

```bash
python craft package:publish backup
```

### Usage

Once you publish the package resources, you can use the `backup` command to backup your database and files. Before that if you want to configure options of backup then you can do that by updating `config/backup.py` configuration file.

```python
# config/backup.py

FILENAME = "backup"
DIRECTORY = "backup"
SOURCE = {
    "root": base_path(),
    "excludes": [
        ".git",
        "storage",
        "venv",
        "node_modules",
        "__pycache__",
        # add more...
    ],
}

S3_BACKUP = False # Whether or not to backup to S3.
EMAIL_BACKUP = False  # Whether or not to email the backup.
EMAIL_BACKUP_TO = ""  # The email address to send the backup to.
EMAIL_SUBJECT = "System Backup"  # The email subject.
```
> Note: Make sure you have `EMAIL_BACKUP` set to `True` and `EMAIL_BACKUP_TO` set to a valid email address, to send the backup via email. Also don't forget to setup SMTP in `config/mail.py` configuration file or in `.env` file. In case you want to backup to S3, then make sure you have `S3_BACKUP` set to `True` and S3 storage configuration.

```sh
MAIL_DRIVER=smtp
MAIL_FROM=
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=

AWS_CLIENT=
AWS_SECRET=
AWS_BUCKET=
AWS_REGION=
```

**Backup Database and Files**

```bash
python craft backup:run
```

**Backup Database Only**

```bash
python craft backup:run --only-db
```

**Backup Files Only**

```bash
python craft backup:run --only-files
```

## License

Backup is open-sourced software licensed under the [MIT license](LICENSE).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/py-package/masonite-backup",
    "name": "masonite-backup",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Masonite,Python,Development",
    "author": "Yubaraj Shrestha",
    "author_email": "yubaraj@pypackage.com",
    "download_url": "https://files.pythonhosted.org/packages/7c/c9/6d9dfbec337767d5b7a6e9f68c92c83f1e9bf2ef4ae31e561d3f4012a6d4/masonite-backup-0.0.4.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n<img src=\"https://banners.beyondco.de/Masonite%20Backup.png?theme=light&packageManager=pip+install&packageName=masonite-backup&pattern=charlieBrown&style=style_2&description=Backup+solution+for+Masonite+Apps.&md=1&showWatermark=1&fontSize=100px&images=adjustments&widths=50&heights=50\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://docs.masoniteproject.com\">\n    <img alt=\"Masonite Package\" src=\"https://img.shields.io/static/v1?label=Masonite&message=package&labelColor=grey&color=blue&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAA6gAwAEAAAAAQAAAA4AAAAATspU+QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPS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eXqxQevB4prrqgc0TmQ85NG/K43e2UwnMVAJIEBNfWRYR3HfnvivrIzMyo4Hgy+hfscvLo53jItAAAAABJRU5ErkJggg==\">\n  </a>\n  <img alt=\"GitHub Workflow Status (branch)\" src=\"https://github.com/py-package/masonite-backup/actions/workflows/pythonapp.yml/badge.svg\">\n  <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/masonite-backup\">\n  <img src=\"https://img.shields.io/badge/python-3.7+-blue.svg\" alt=\"Python Version\">\n  <img alt=\"GitHub release (latest by date including pre-releases)\" src=\"https://img.shields.io/github/v/release/py-package/masonite-backup?include_prereleases\">\n  <img alt=\"License\" src=\"https://img.shields.io/github/license/py-package/masonite-backup\">\n  <a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\n</p>\n\n# Masonite Backup\n\nBackup solution for Masonite.\n\n### Features\n\n- [x] Backup Database\n- [x] Backup Files\n- [x] Store Backup Locally in the filesystem\n- [x] Email Backup\n- [x] Store Backup in other Masonite Supported Storage Drivers [s3]\n\n\n### Installation\n\n```bash\npip install masonite-backup\n```\n\n### Configuration\n\nAdd BackupProvider to your project in `config/providers.py`:\n\n```python\n# config/providers.py\n# ...\nfrom backup import BackupProvider\n\n# ...\nPROVIDERS = [\n    # ...\n    # Third Party Providers\n    BackupProvider,\n    # ...\n]\n```\n\nThen you can publish the package resources (if needed) by doing:\n\n```bash\npython craft package:publish backup\n```\n\n### Usage\n\nOnce you publish the package resources, you can use the `backup` command to backup your database and files. Before that if you want to configure options of backup then you can do that by updating `config/backup.py` configuration file.\n\n```python\n# config/backup.py\n\nFILENAME = \"backup\"\nDIRECTORY = \"backup\"\nSOURCE = {\n    \"root\": base_path(),\n    \"excludes\": [\n        \".git\",\n        \"storage\",\n        \"venv\",\n        \"node_modules\",\n        \"__pycache__\",\n        # add more...\n    ],\n}\n\nS3_BACKUP = False # Whether or not to backup to S3.\nEMAIL_BACKUP = False  # Whether or not to email the backup.\nEMAIL_BACKUP_TO = \"\"  # The email address to send the backup to.\nEMAIL_SUBJECT = \"System Backup\"  # The email subject.\n```\n> Note: Make sure you have `EMAIL_BACKUP` set to `True` and `EMAIL_BACKUP_TO` set to a valid email address, to send the backup via email. Also don't forget to setup SMTP in `config/mail.py` configuration file or in `.env` file. In case you want to backup to S3, then make sure you have `S3_BACKUP` set to `True` and S3 storage configuration.\n\n```sh\nMAIL_DRIVER=smtp\nMAIL_FROM=\nMAIL_HOST=\nMAIL_PORT=\nMAIL_USERNAME=\nMAIL_PASSWORD=\n\nAWS_CLIENT=\nAWS_SECRET=\nAWS_BUCKET=\nAWS_REGION=\n```\n\n**Backup Database and Files**\n\n```bash\npython craft backup:run\n```\n\n**Backup Database Only**\n\n```bash\npython craft backup:run --only-db\n```\n\n**Backup Files Only**\n\n```bash\npython craft backup:run --only-files\n```\n\n## License\n\nBackup is open-sourced software licensed under the [MIT license](LICENSE).\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Backup solution for Masonite.",
    "version": "0.0.4",
    "split_keywords": [
        "masonite",
        "python",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "07ec60be01b2b9df42d45f1bdfcc35ce",
                "sha256": "f4feaabbefc376c24607342ee0509fb98fda1b4adf24f9c8f5bff74d25995908"
            },
            "downloads": -1,
            "filename": "masonite_backup-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07ec60be01b2b9df42d45f1bdfcc35ce",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9683,
            "upload_time": "2022-12-31T03:44:42",
            "upload_time_iso_8601": "2022-12-31T03:44:42.187615Z",
            "url": "https://files.pythonhosted.org/packages/f9/80/67c4e54b26f92c79c42e0ef46ca3cab38bbc352c59d37032fe1b1ac29bd8/masonite_backup-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4cb05a8ecc788afd7f06c56fb4283a20",
                "sha256": "26195746f515f6cc5d1d22439ddab8b2690b103730e0d34822392f3c420a13c1"
            },
            "downloads": -1,
            "filename": "masonite-backup-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "4cb05a8ecc788afd7f06c56fb4283a20",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12035,
            "upload_time": "2022-12-31T03:44:43",
            "upload_time_iso_8601": "2022-12-31T03:44:43.440542Z",
            "url": "https://files.pythonhosted.org/packages/7c/c9/6d9dfbec337767d5b7a6e9f68c92c83f1e9bf2ef4ae31e561d3f4012a6d4/masonite-backup-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-31 03:44:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "py-package",
    "github_project": "masonite-backup",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "masonite",
            "specs": [
                [
                    ">=",
                    "4"
                ],
                [
                    "<",
                    "5"
                ]
            ]
        },
        {
            "name": "masonite-orm",
            "specs": [
                [
                    "<",
                    "3"
                ],
                [
                    ">=",
                    "2"
                ]
            ]
        }
    ],
    "lcname": "masonite-backup"
}
        
Elapsed time: 0.37981s