Closed jannikw closed 4 years ago
Another good name for the flag could be GROUP_BACKUPS_BY_PROJECT_NAME
.
Looks reasonable. I actually think I had something like this initially but somehow decided to simplify it. I think also GROUP_BACKUPS_BY_PROJECT_NAME
might be better, but I'll merge this now and modify if needed.
When running multiple projects simultaneously where each contains a service with the same name, backups for these services will be merged into one directory. For example take the
docker-compose.yml
from below, copy it to different directories namedproject1
andproject2
. Now calldocker-compose up -d
from each directory and trigger a backup. Backups for both services will be saved in the same subdirectory of/volumes/...
since the service names are the same.The same thing applies to databases, just that they are saved in
/databases/...
Therefore I propose a new configuration flag set via the environment variable
INCLUDE_PROJECT_NAME
. If the flag is set to false (which it is per default) then the old behavior for the backup destination is chosen. If the flag is set to true, the volume backups will be placed at/volumes/<project name>/<service name>/...
and the database backups at/databases/<project name>/<service name>/...
.In order to make viewing the destination paths of the backups a little easier I also extended the output of the
status
command to include the destination paths. The output now looks like this for the test compose file: