Установка:
1 |
apt install git etckeeper |
Поправить /etc/cron.daily/etckeeper:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
!!! Не обязательно, добавить etckeeper commit "daily autocommit" >/dev/null 2>/dev/null !!! Убирает лишнюю разговорчивость etckeeper #!/bin/sh set -e if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then . /etc/etckeeper/etckeeper.conf if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then # avoid autocommit if an install run is in progress lockfile=/var/cache/etckeeper/packagelist.pre-install if [ -e "$lockfile" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then rm -f "$lockfile" # stale fi if [ ! -e "$lockfile" ]; then AVOID_SPECIAL_FILE_WARNING=1 export AVOID_SPECIAL_FILE_WARNING if etckeeper unclean; then etckeeper commit "daily autocommit" >/dev/null 2>/dev/null fi fi fi fi |
Создать ключ и прописать в конфиг ssh:
1 2 3 4 5 6 7 8 9 10 |
0. Генерируем ключ ssh-keygen -b 2048 -t rsa -f /etc/etckeeper/id_rsa -q -N "" 1. Правим файл /root/.ssh/config vim /root/.ssh/config ------------------------ Host etckeeper.DOMAN_NAME User USER_NAME_GIT IdentityFile /etc/etckeeper/id_rsa ------------------------ |
Добавить репозиторий (предварительно создав его на etckeeper.YOU_DOMAN_NAME):
1 2 3 |
cd /etc etckeeper init git remote add origin ssh://USER_NAME_GIT@etckeeper.YOU_DOMAN_NAME:29418/YOU_REPO_NAME.git |
Поправить конфиг /etc/etckeeper/etckeeper.conf
1 2 3 4 5 |
vim /etc/etckeeper/etckeeper.conf ---------------------------------- VCS="git" PUSH_REMOTE="origin" ---------------------------------- |
Добавить ключ в etckeeper:
1 2 |
cd /etc/etckeeper/ cat id_rsa.pub | ssh -l USER_NAME_GIT -p 29418 etckeeper.YOU_DOMAN_NAME keys add |
Протестировать:
1 2 |
cd /etc git push -u origin master |