Skip to main content

Masonite Package GitHub Workflow Status (branch) PyPI Python Version GitHub release (latest by date including pre-releases) License Code style: black

Masonite Backup

Backup solution for Masonite.

Features

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

Installation

pip install masonite-backup

Configuration

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

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

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

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

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.

# 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.

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

python craft backup:run

Backup Database Only

python craft backup:run --only-db

Backup Files Only

python craft backup:run --only-files

License

Backup is open-sourced software licensed under the MIT license.

Metadata

Release files for masonite-backup 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for masonite-backup 0.0.4
File Size Uploaded Provenance Actions
masonite-backup-0.0.4.tar.gz 12.0 kB Without provenance Details for masonite-backup-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for masonite-backup 0.0.4
File Interpreter ABI Platform Actions
masonite_backup-0.0.4-py3-none-any.whl Python 3 none any Details for masonite_backup-0.0.4-py3-none-any.whl

Total release size: 21.7 kB

Release files / masonite-backup-0.0.4.tar.gz

Download URL masonite-backup-0.0.4.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
26195746f515f6cc5d1d22439ddab8b2690b103730e0d34822392f3c420a13c1
BLAKE2b-256 checksum
How to use checksums
7cc96d9dfbec337767d5b7a6e9f68c92c83f1e9bf2ef4ae31e561d3f4012a6d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / masonite_backup-0.0.4-py3-none-any.whl

Download URL masonite_backup-0.0.4-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4feaabbefc376c24607342ee0509fb98fda1b4adf24f9c8f5bff74d25995908
BLAKE2b-256 checksum
How to use checksums
f98067c4e54b26f92c79c42e0ef46ca3cab38bbc352c59d37032fe1b1ac29bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Security for masonite-backup 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page