Just if anyone finds this useful: In addition to having full tar backups, I like to track changes of important files in git, so I have a full history.
Nothing brilliant but works.
- Install git. I did this on the host.
- setup repo with:
filelist.txt
containing all the files that you want to track, e.g.:
Code:# container configs /etc/pve/lxc/100.conf /etc/pve/lxc/102.conf /etc/pve/lxc/103.conf # storage config /etc/pve/storage.cfg # user config /etc/pve/user.cfg # special files /etc/pve/.vmlist /etc/pve/.version /etc/pve/.members /etc/pve/status.cfg # docker mod /etc/modules-load.d/modules.conf # apt sources /etc/apt/sources.list.d/pve-enterprise.list
get-files.sh
, for updating files from sources, reproducing full paths in the repo, e.g.:
Code:
#!/bin/bash
################################################################################
#
# Shell script to copy important configuration files from the current
# environment to this repository.
#
################################################################################
# Exit as soon as a command fails
set -e
# Accessing an empty variable will yield an error
set -u
# Full path to repo directory
REPO_PATH="/backups/configs/proxmox/"
# copy all files from filelist.txt, excluding comments, recreate all paths on target directory
grep -e '^[^#]' "$REPO_PATH/filelist.txt" | xargs cp --parents --target-directory "$REPO_PATH"
echo "Completed."
- run with
bash get-files.sh
Nothing brilliant but works.
Last edited: