# Telescoop Backup
Backup your sqlite database to an S3 compatible provider.
## Quick start
### Configuration
- Add "Telescop Backup" to your INSTALLED_APPS setting like this::
```python
INSTALLED_APPS = [
...
'telescoop_backup',
]
```
- Include the Telescop Backup URLconf in your project urls.py like this::
```python
path('backup/', include('telescoop_backup.urls')),
```
- Define the following settings in `settings.py`
```python
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)
```
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 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
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/telescoop-public/django-apps/telescoop-backup",
"name": "telescoop-backup",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "TelesCoop SARL SCOP",
"author_email": "contact@telescoop.fr",
"download_url": "https://files.pythonhosted.org/packages/7f/5b/d1ae5e1e208f8a766faf538139ad6e0f985f954be58689dca994109884e8/telescoop-backup-0.1.8.tar.gz",
"platform": null,
"description": "# Telescoop Backup\n\nBackup your sqlite database to an S3 compatible provider.\n\n## Quick start\n\n### Configuration\n\n- Add \"Telescop Backup\" to your INSTALLED_APPS setting like this::\n\n```python\nINSTALLED_APPS = [\n ...\n 'telescoop_backup',\n]\n```\n\n- Include the Telescop Backup URLconf in your project urls.py like this::\n\n```python\n path('backup/', include('telescoop_backup.urls')),\n```\n\n- Define the following settings in `settings.py`\n\n```python\nBACKUP_ACCESS = 'my_access' # S3 ACCESS\nBACKUP_SECRET = 'my_secret' # S3 SECRET KEY\nBACKUP_BUCKET = 'my_project_backup' # S3 Bucket\nBACKUP_KEEP_N_DAYS = 31 # Optional, defaults to 31\nBACKUP_HOST = None # Optional, default to s3.fr-par.scw.cloud (Scaleway Storage)\n```\n\nBy default, old backups are removed in order not to take up too much space.\nIf you don't want them removed, just set a very large value for BACKUP_KEEP_N_DAYS.\n\n### Backup\n\nYou can now backup with the `backup_db` management command :\n\n- `python manage.py backup_db backup` to back up current database\n- `python manage.py backup_db media` to back up `settings.MEDIA_ROOT`\n- `python manage.py backup_db list` to list previous backups\n- `python manage.py backup_db recover [file_name]` to recover previous database\n\n### View last backup and if it is recent\n\n- `/backup/last-backup` shows the latest backup\n- `/backup/backup-is-less-than-XX-hours-old` answers\n`yes` (status 200) or `no` (status 500). This route can be used with a service\nsuch as uptimerobot.com.\n\n### Gitignore\n\nIf you use it in local environment, ignore the backup files\n```\n.telescoop_backup_last_backup\n*.sqlite\n```\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Django app to backup Sqlite or Postgres database to an S3 Object Storage.",
"version": "0.1.8",
"project_urls": {
"Homepage": "https://gitlab.com/telescoop-public/django-apps/telescoop-backup"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "026dc5325a9bda203fb39ccb408c1668fc1338436a71a9cd206babdbce4dfdac",
"md5": "730c8973bd394a5cdab23ed923b9ba63",
"sha256": "e73c6e9a1ff64b677f4a595f35e65fb327b9adc35870e168f697d447774e7940"
},
"downloads": -1,
"filename": "telescoop_backup-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "730c8973bd394a5cdab23ed923b9ba63",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10274,
"upload_time": "2024-01-09T12:11:00",
"upload_time_iso_8601": "2024-01-09T12:11:00.080746Z",
"url": "https://files.pythonhosted.org/packages/02/6d/c5325a9bda203fb39ccb408c1668fc1338436a71a9cd206babdbce4dfdac/telescoop_backup-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f5bd1ae5e1e208f8a766faf538139ad6e0f985f954be58689dca994109884e8",
"md5": "22eb30d375ee54d2bb45148c5d3127ca",
"sha256": "8ccfdf558754eb712368ae05da5e6be54ea77022337e980f8fa95de279ed720e"
},
"downloads": -1,
"filename": "telescoop-backup-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "22eb30d375ee54d2bb45148c5d3127ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9017,
"upload_time": "2024-01-09T12:11:02",
"upload_time_iso_8601": "2024-01-09T12:11:02.073271Z",
"url": "https://files.pythonhosted.org/packages/7f/5b/d1ae5e1e208f8a766faf538139ad6e0f985f954be58689dca994109884e8/telescoop-backup-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-09 12:11:02",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "telescoop-public",
"gitlab_project": "django-apps",
"lcname": "telescoop-backup"
}