Skip to main content

Django app to backup Sqlite or Postgres database to an S3 Object Storage.

Project description

Telescoop Backup

Backup your sqlite database to an S3 compatible provider.

Quick start

Configuration

  • Add "Telescop Backup" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
    ...
    'telescoop_backup',
]
  • Include the Telescop Backup URLconf in your project urls.py like this::
    path('backup/', include('telescoop_backup.urls')),
  • Define the following settings in settings.py
BACKUP_ACCESS = 'my_access'  # S3 ACCESS
BACKUP_SECRET = 'my_secret'  # S3 SECRET KEY
BACKUP_BUCKET = 'my_project_backup'  # S3 Bucket
BACKUP_KEEP_N_DAYS = 31  # Optional, defaults to 31
BACKUP_HOST = None  # Optional, default to s3.fr-par.scw.cloud (Scaleway Storage in Paris)

# Optional, for compressing the backup
BACKUP_COMPRESS = True
BACKUP_RECOVER_N_WORKERS = 4  # Optional, default to 1

By default, old backups are removed in order not to take up too much space. If you don't want them removed, just set a very large value for BACKUP_KEEP_N_DAYS.

Backup

You can now backup with the backup_db management command :

  • python manage.py backup_db backup to back up current database
  • python manage.py backup_db backup_media to back up settings.MEDIA_ROOT
  • python manage.py backup_db list to list previous backups
  • python manage.py backup_db recover [file_name] to recover previous database

View last backup and if it is recent

  • /backup/last-backup shows the latest backup
  • /backup/backup-is-less-than-XX-hours-old answers yes (status 200) or no (status 500). This route can be used with a service such as uptimerobot.com.

Gitignore

If you use it in local environment, ignore the backup files

.telescoop_backup_last_backup
*.sqlite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telescoop_backup-0.5.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telescoop_backup-0.5.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file telescoop_backup-0.5.0.tar.gz.

File metadata

  • Download URL: telescoop_backup-0.5.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for telescoop_backup-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ac7a0047d1948be6e018a3f4fa1ce60238c2354c8d14b1df274889c232cbb66e
MD5 fcc9b6a9049290395c8b6194a62ca411
BLAKE2b-256 65e4b3c3ea031d703a6c5ea6f80e04e8c5b5b9c5b788cb45506302b55c60d639

See more details on using hashes here.

File details

Details for the file telescoop_backup-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for telescoop_backup-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 741dafc1a4b216e97fb9c8097515dcc8128330fb3f7b4fb1e6fe7acec708cf09
MD5 36ccda5da847fcef03f874935ccf5c00
BLAKE2b-256 308fd577836f17cc09625be9234fdc5fddb3287d12a1d5e6310d4523a86c3565

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page