erikdewildt / django-rotating-backup Goto Github PK
View Code? Open in Web Editor NEWA simple Django app to make rotating backups of the Django database and media files.
License: GNU General Public License v3.0
A simple Django app to make rotating backups of the Django database and media files.
License: GNU General Public License v3.0
Here, the PostgreSQL password is passed on the command line of the sh
command, in order to get it into the environment of pg_dump
.
This is a security issue, because command lines of running processes are world-readbale to anyone who has access to the system (regular shell users as well as attackers who get as far as calling ps ax
).
Never do this, it is one of the most discouraged anti-patterns. Actually, this is the one reason why the PGPASSWORD
environment variable was introduced โ to stop people from passing their password on the command-line!
When I try to back up a MySQL database I get this warning logged.
Database 'default' is not supported as the type is 'mysql'
From what I can see in backup.py it seems only SQLite and PostgreSQL are supported.
My backup settings are:
DRB_ENABLE_SQLITE_BACKUP_COPY = False
DRB_ENABLE_DATABASE_DUMPS = True
DRB_ENABLE_MEDIA_BACKUPS = False
DRB_ENABLE_REMOTE_SYNC = False
When I run the backup I get the following error:
Traceback (most recent call last): File "./manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute output = self.handle(*args, **options) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django_rotating_backup/management/commands/create_backup.py", line 13, in handle RotatingBackup().run() File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django_rotating_backup/backup.py", line 289, in run backup_file = self.make_media_backup(destination=destination, pattern=hour_pattern) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/site-packages/django_rotating_backup/backup.py", line 187, in make_media_backup backup_file.add(file) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/tarfile.py", line 1949, in add recursive, filter=filter) File "/Users/user/.virtualenvs/workinghours/lib/python3.7/tarfile.py", line 1947, in add for f in sorted(os.listdir(name)): PermissionError: [Errno 13] Permission denied: '/.DocumentRevisions-V100'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.