refactor: better logging for borgmatic cron tasks
Example from what @michel-thomas did
MAILTO=support@lydra.fr
SHELL=/bin/bash
0 2 * * * root export PATH="/opt/borgmatic/bin:${PATH}"; borgmatic -c /etc/borgmatic/borg_local_repo >> /var/log/borgmatic/borg_local_repo.log 2> >(tee -a /var/log/borgmatic/borg_local_repo.log >&2)
0 3 * * * root export PATH="/opt/borgmatic/bin:${PATH}"; borgmatic -c /etc/borgmatic/borg_remote_repo >> /var/log/borgmatic/borg_remote_repo.log 2> >(tee -a /var/log/borgmatic/borg_remote_repo.log >&2)
0 12 1 * * root export PATH="/opt/borgmatic/bin:${PATH}"; borgmatic compact -c /etc/borgmatic/borg_local_repo >> /var/log/borgmatic/borg_local_repo.log 2> >(tee -a /var/log/borgmatic/borg_local_repo.log >&2)
0 17 1 * * root export PATH="/opt/borgmatic/bin:${PATH}"; borgmatic compact -c /etc/borgmatic/borg_remote_repo >> /var/log/borgmatic/borg_remote_repo.log 2> >(tee -a /var/log/borgmatic/borg_remote_repo.log >&2)
Edited by Arthur Boudreault