Fixes #707 Move Backups out of Devilbox directory

This commit is contained in:
cytopia 2020-11-14 11:51:33 +01:00
parent 6735daaaeb
commit 1f0676de4a
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
7 changed files with 85 additions and 4 deletions

View File

@ -15,6 +15,10 @@ major versions.
- [#749](https://github.com/cytopia/devilbox/issues/749) Fix to disable PHP modules without `*.so` ext
- Fixed `check-config.sh` to properly expand `~` character in path
#### Added
- [#707](https://github.com/cytopia/devilbox/issues/707) New `.env` variable: `HOST_PATH_BACKUPDIR`
## Release v1.8.1 (2020-11-12)

View File

@ -361,7 +361,6 @@ print_head_1 "Checking directory permissions"
DEVILBOX_DIRS=(
"autostart"
"backups"
"bash"
"ca"
"cfg"
@ -426,7 +425,6 @@ print_head_1 "Checking file permissions"
DEVILBOX_DIRS=(
"autostart"
"backups"
"ca"
"cfg"
"compose"

View File

@ -183,7 +183,7 @@ services:
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
# Mount DB Backup directory
- ${DEVILBOX_PATH}/backups:/shared/backups:rw${MOUNT_OPTIONS}
- ${HOST_PATH_BACKUPDIR:-./backups}:/shared/backups:rw${MOUNT_OPTIONS}
# Mount devilbox user-defined *.ini files in order
# to overwrite the default PHP.ini configuration

View File

@ -959,6 +959,22 @@ always be ``/shared/httpd/``.
``docker-compose rm``.
.. _env_host_path_backupdir:
HOST_PATH_BACKUPDIR
-------------------
The path on your host OS of the database backup directory to be mounted into the
PHP container into ``/shared/backups``.
+------------------------------+----------------+----------------+
| Name | Allowed values | Default value |
+==============================+================+================+
| ``HOST_PATH_BACKUPDIR`` | valid path | ``./backups`` |
+------------------------------+----------------+----------------+
HOST_PATH_SSH_DIR
-----------------

View File

@ -0,0 +1,40 @@
:orphan:
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst
.. _howto_move_backups_to_a_different_directory:
*************************************
Move backups to a different directory
*************************************
No matter if your backups are already in a different location or if you want to move them out of
the Devilbox git directory now, you can do that in a few simple steps.
**Table of Contents**
.. contents:: :local:
Move backups out of the Devilbox git directory
==============================================
All you have to to is to adjust the path of :ref:`env_host_path_backupdir` in the ``.env`` file.
.. code-block:: bash
# Navigate to Devilbox git directory
host> cd path/to/devilbox
# Open the .env file with your favourite editor
host> vim .env
Now Adjust the value of :ref:`env_host_path_backupdir`
.. code-block:: bash
:caption: .env
:emphasize-lines: 1
HOST_PATH_HTTPD_DATADIR=/home/user/backups/devilbox/
That's it, whenever you start up the Devilbox, ``/home/user/backups/devilbox/`` will be mounted into
the PHP container into ``/shared/backups/``.

View File

@ -26,14 +26,26 @@ having to worry about loosing any project data. There could also be the case tha
dedicated hard-disk to store your projects or you have your own idea about a directory structure
where you want to store your projects.
Affected env variables to consider changing:
* :ref:`env_httpd_datadir`
* :ref:`env_host_path_backupdir`
Projects
--------
.. seealso::
:ref:`howto_move_projects_to_a_different_directory`
* :ref:`howto_move_projects_to_a_different_directory`
Follow this guide to keep your projects separated from the Devilbox git directory.
Backups
-------
.. seealso::
* :ref:`howto_move_backups_to_a_different_directory`
Follow this guide to keep your backups separated from the Devilbox git directory.
Version control ``.env`` file
-----------------------------

View File

@ -465,6 +465,17 @@ MOUNT_OPTIONS=
HOST_PATH_HTTPD_DATADIR=./data/www
###
### Local filesystem path to where your backups are stored
###
### Note: When changing this variable you must re-create the container.
### Simply remove it, it will be auto-created during the next start:
###
### $ docker-compose rm -f
###
HOST_PATH_BACKUPDIR=./backups
###
### The path on your host OS of the ssh directory to be mounted into the
### PHP container into /home/devilbox/.ssh.