Debian Codegraph @

docs/src/commands.md

raw
1 # Commands
2
3 DBBackup exposes Django management commands for creating and restoring
4 database and media backups. Without extra arguments `dbbackup` and
5 `mediabackup` create a backup and upload it to the configured
6 `STORAGES['dbbackup']` backend; `dbrestore` / `mediarestore` download and
7 restore the most recent matching backup.
8
9 Use `python manage.py <command> --help` for full option details.
10
11 ---
12
13 ## dbbackup
14
15 Create a database backup (optionally compressed/encrypted) and upload it.
16
17 ```bash
18 $ python manage.py dbbackup
19 Backing Up Database: tmp.x0kN9sYSqk
20 Backup size: 3.3 KiB
21 Writing file to tmp-zuluvm-2016-07-29-100954.dump
22 ```
23
24 For parameters and more information, run:
25
26 ```bash
27 python manage.py dbbackup --help
28 ```
29
30 ## dbrestore
31
32 Download the latest database backup (or a specified one) then restore it.
33
34 ```bash
35 $ python manage.py dbrestore
36 Restoring backup for database: tmp.x0kN9sYSqk
37 Finding latest backup
38 Restoring: tmp-zuluvm-2016-07-29-100954.dump
39 Restore tempfile created: 3.3 KiB
40 ```
41
42 For parameters and more information, run:
43
44 ```bash
45 python manage.py dbrestore --help
46 ```
47
48 ## mediabackup
49
50 Create an archive (tar) of media files, optionally compress/encrypt, and upload
51 it to backup storage.
52
53 ```bash
54 $ python manage.py mediabackup
55 Backup size: 10.0 KiB
56 Writing file to zuluvm-2016-07-04-081612.tar
57 ```
58
59 For parameters and more information, run:
60
61 ```bash
62 python manage.py mediabackup --help
63 ```
64
65 ## mediarestore
66
67 Restore media files: extract files from the archive and put them into media storage.
68
69 ```bash
70 $ python manage.py mediarestore
71 Restoring backup for media files
72 Finding latest backup
73 Reading file zuluvm-2016-07-04-082551.tar
74 Restoring: zuluvm-2016-07-04-082551.tar
75 Backup size: 10.0 KiB
76 Are you sure you want to continue? [Y/n]
77 2 file(s) restored
78 ```
79
80 For parameters and more information, run:
81
82 ```bash
83 python manage.py mediarestore --help
84 ```
85
86 ## listbackups
87
88 This command lists backups filtered by type (`'media'` or `'db'`), compression, or encryption.
89
90 For parameters and more information, run:
91
92 ```bash
93 python manage.py listbackups --help
94 ```