Yes.
Native installation
sudo CONFIG_FILE=/home/user/bmus_alternative.conf /home/user/bmus.sh
You can also add several cronjobs that execute different configs.
Open crontab.
sudo crontab -e
Daily at 3:00 a.m. and 6:00 a.m. with alternative configs.
0 3 * * * CONFIG_FILE=/home/user/bmus.conf /home/user/bmus.sh
0 6 * * * CONFIG_FILE=/home/user/bmus_alternative.conf /home/user/bmus.sh
Docker installation
sudo docker exec -it -e CONFIG_FILE=/config/bmus_alternative.conf bmus_backup /app/bmus.sh [ARGUMENTS]
Make sure that bmus_alternative.conf is in the config/ folder.
Daily at 3:00 a.m. and 6:00 a.m. with alternative docker configs.
0 4 * * * sudo docker exec -e CONFIG_FILE=/config/bmus.conf bmus_backup /app/bmus.sh
0 18 * * * sudo docker exec -e CONFIG_FILE=/config/bmus_alternative.conf bmus_backup /app/bmus.sh
You could also tweak the docker-compose.yml.
But since the Docker container (more precisely, the entrypoint.sh script) is hard-coded to always load /config/bmus.conf, you nee to use a “mount trick” here:
For the second container (bmus_alternative), we mount the file bmus_alternative.conf (from the host) directly over bmus.conf (in the container). The container “thinks” it is loading the default configuration, but in reality it is reading your second configuration.
services:
# ---------------------------------------------------------
# 1. Standard container (uses bmus.conf)
# ---------------------------------------------------------
bmus:
image: backmeupscotty/bmus:latest
container_name: bmus_backup
restart: unless-stopped
privileged: true
volumes:
- ./config:/config
- /:/host_root:ro
environment:
- TZ=Europe/Berlin
# ----------------------------------- ----------------------
# 2. Second container (uses bmus_alternative.conf)
# ------------------------------------------------------ ---
bmus_secondary:
image: backmeupscotty/bmus:latest
container_name: bmus_backup_secondary
restart: unless-stopped
privileged: true
volumes:
# First mount the entire folder (for credentials, etc.)
- ./config:/config
# TRICK: We overwrite the bmus.conf in the container with the bmus_alternative.conf from the host
- ./config/bmus_alternative.conf:/config/bmus.conf
# OPTIONAL: We also redirect the log file so that they don't get mixed up
# (Host: bmus_alternative.log -> Container: bmus.log)
# IMPORTANT: Create an empty ‘bmus_alternative.log’ on the host beforehand!
- ./config/bmus_alternative.log:/config/bmus.log
- /:/host_root:ro
environment:
- TZ=Europe/Berlin
Both containers now run completely independently of each other. This means you can define completely different schedules (CRON_SCHEDULE), backup destinations, or sources in bmus_alternative.conf than in the first file.