A proper backup depends on being performed regularly. If you always had to initiate it manually, sooner or later it would become incomplete.
That’s why you should define a cron job and specify when BmuS should run.
Here are a few examples.
Open crontab.
sudo crontab -e
Every day at 2:00 a.m.
0 2 * * * /home/user/bmus.sh
Daily at 3:00 a.m. and 6:00 a.m. with alternative configs.
0 3 * * * CONFIG_FILE=/home/user/bmus_alternative.conf /home/user/bmus.sh
0 6 * * * CONFIG_FILE=/home/user/bmus_alternative2.conf /home/user/bmus.sh
Weekly Sundays at 4:00 a.m
0 4 * * 0 /home/user/bmus.sh
Docker Version
If you are using the Docker version of BmuS, the cron job must be entered at the end of bmus.conf and will then be automatically passed into the container.
# ---------------------------------------------------------
# DOCKER CONTAINER SETTINGS
# ----------- ---------------------------------------------
# This section is ONLY evaluated by the Docker container (entrypoint.sh).
# The actual backup script ignores these lines.
#
# Schedule for automatic backups (cron format):
# Minute Hour Day Month Weekday
#
# Examples:
# “0 3 * * *” = Daily at 3:00 a.m.
# “30 2 * * 0” = Every Sunday at 2:30 a.m.
# “” = Leave blank for manual mode (no automation)
#
CRON_SCHEDULE="0 3 * * *"
If you want to run the backup at 3:00 a.m. and 3:00 p.m., change the line in bmus.conf as follows:
CRON_SCHEDULE="0 3,15 * * *"
Important detail regarding syntax: Be sure not to add spaces after the commas.
✅ Correct: 3,15,22
❌ Incorrect: 3, 15, 22 (This would result in an error).
Windows
Windows users can alternatively use schtasks to define a “cron job”, but it works too with the method above, since the cron schedule is passed to the docker container.
schtasks /create /tn "BmuS Backup" /tr "docker exec -e CONFIG_FILE=/config/bmus.conf bmus_backup /app/bmus.sh" /sc daily /st 04:00