Script to automate Debian GNU/Linux config backup into a Git repo
Install dependencies (coreutils
, rsync
and git
) before using this script, e. g. like this:
sudo apt-get update && sudo apt-get install -y coreutils rsync git
./backuplinuxcfgstogit.sh ./example-file-list.txt gitusername [email protected] [email protected]:user/target-git-repository-from-user.git
You might want to create a regular cron job for the script to take action, e. g. a file like this:
root@machine:~# cat /etc/cron.weekly/trigger-backuplinuxcfgstogit
#!/bin/bash
eval "$(ssh-agent -s)"
ssh-add .ssh/github
./backuplinuxcfgstogit.sh ./example-file-list.txt gitusername [email protected] [email protected]:user/target-git-repository-from-user.git >> /tmp/backuplinuxcfgstogit.log