Версия: 2.0.0
Дата: 2025-12-18
┌─────────────────────────────────────────────────────────────────┐
│ DISASTER RECOVERY CARD │
│ Сохраните в безопасном месте! │
├─────────────────────────────────────────────────────────────────┤
│ │
│ S3 BACKUP BUCKET: fe2c1d30dc11-bs (beget-infra) │
│ S3 DATA BUCKET: fe2c1d30dc11-s3-0kt (beget-s3) │
│ S3 ENDPOINT: https://s3.ru1.storage.beget.cloud │
│ │
│ AWS_ACCESS_KEY_ID (backup): │
│ 15PWO3ZAEMM3LP7LFQYO │
│ │
│ AWS_SECRET_ACCESS_KEY (backup): │
│ LmGiAkLOUdjOnPbGEBRRTdfJWzw0gul99WRbgEnN │
│ │
│ RESTIC_PASSWORD: │
│ k9oj9ucwvbfAzTHSDzO/3GE1Zom87o4LYeQq/wdGB+k= │
│ │
└─────────────────────────────────────────────────────────────────┘
На чистом Ubuntu 22.04 сервере:
# 1. Установить rclone
curl https://rclone.org/install.sh | bash
# 2. Примонтировать infra bucket
mkdir -p /mnt/beget-infra
rclone config create beget-infra s3 provider=Other \
access_key_id=15PWO3ZAEMM3LP7LFQYO \
secret_access_key=LmGiAkLOUdjOnPbGEBRRTdfJWzw0gul99WRbgEnN \
endpoint=s3.ru1.storage.beget.cloud
rclone mount beget-infra:fe2c1d30dc11-bs /mnt/beget-infra --daemon --vfs-cache-mode full
# 3. Запустить recovery
/mnt/beget-infra/_settings/recovery/scripts/recovery-levels.sh
Время восстановления: ~20 минут
| Bucket | Назначение | Mount |
|---|---|---|
beget-infra (fe2c1d30dc11-bs) |
Бекапы, recovery | /mnt/beget-infra |
beget-s3 (fe2c1d30dc11-s3-0kt) |
Данные проектов | /mnt/beget-s3 |
apt update && apt install -y curl wget git bzip2
# Docker
curl -fsSL https://get.docker.com | sh
# Restic
curl -LO https://github.com/restic/restic/releases/download/v0.18.1/restic_0.18.1_linux_amd64.bz2
bunzip2 restic_0.18.1_linux_amd64.bz2
chmod +x restic_0.18.1_linux_amd64
mv restic_0.18.1_linux_amd64 /usr/local/bin/restic
# rclone
curl https://rclone.org/install.sh | bash
mkdir -p ~/.config/rclone
cat > ~/.config/rclone/rclone.conf << 'EOF'
[beget-infra]
type = s3
provider = Other
access_key_id = 15PWO3ZAEMM3LP7LFQYO
secret_access_key = LmGiAkLOUdjOnPbGEBRRTdfJWzw0gul99WRbgEnN
endpoint = https://s3.ru1.storage.beget.cloud
acl = private
[beget-s3]
type = s3
provider = Other
access_key_id = F1AIVIQI0DE3PJGIWQC1
secret_access_key = iRDHW0PJsqTb070EDUdOpCQuKwtw7C9POX0KGsmZ
endpoint = https://s3.ru1.storage.beget.cloud
acl = private
EOF
# Монтирование
mkdir -p /mnt/beget-infra /mnt/beget-s3
rclone mount beget-infra:fe2c1d30dc11-bs /mnt/beget-infra --daemon --allow-other --vfs-cache-mode full
rclone mount beget-s3:fe2c1d30dc11-s3-0kt /mnt/beget-s3 --daemon --allow-other --vfs-cache-mode full
export AWS_ACCESS_KEY_ID="15PWO3ZAEMM3LP7LFQYO"
export AWS_SECRET_ACCESS_KEY="LmGiAkLOUdjOnPbGEBRRTdfJWzw0gul99WRbgEnN"
export RESTIC_REPOSITORY="s3:https://s3.ru1.storage.beget.cloud/fe2c1d30dc11-bs/dev-pro/backup/restic"
export RESTIC_PASSWORD="k9oj9ucwvbfAzTHSDzO/3GE1Zom87o4LYeQq/wdGB+k="
# Проверка
restic snapshots
# Восстановление workspace
restic restore latest --target / --tag workspace
# Восстановление SSH ключей
restic restore latest --target / --tag critical
# Восстановление Docker volumes
restic restore latest --target / --tag docker-volumes
# Переменные окружения
echo 'WORKSPACE=/opt/claude-workspace' >> /etc/environment
echo 'DATASPACE=/mnt/beget-s3' >> /etc/environment
source /etc/environment
# Права на SSH
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
# Docker стеки
cd $WORKSPACE/infra
for dir in */; do
if [ -f "$dir/docker-compose.yml" ]; then
(cd "$dir" && docker compose up -d)
fi
done
# Firewall
ufw allow ssh
ufw enable
beget-infra:fe2c1d30dc11-bs/
├── _settings/
│ ├── AGENT.md ← Инструкции для AI
│ └── recovery/ ← Recovery скрипты
│
└── dev-pro/
├── INFO.md ← Описание сервера
├── backup/
│ ├── restic/ ← Restic репозиторий
│ ├── critical/ ← CLAUDE.md, settings
│ ├── golden/ ← Эталонные копии
│ ├── postgres/ ← PostgreSQL дампы
│ ├── simple/ ← Workspace tar.gz
│ └── git/ ← Git bundles
└── archive/ ← Старые бекапы
| Время | Что | Куда |
|---|---|---|
| */6 часов | Critical | backup/critical/ |
| */4 часов | PostgreSQL | backup/postgres/ |
| */6 часов | Restic | backup/restic/ |
| Вс 04:00 | Git full | backup/git/ |
| Пн-Сб 05:00 | Git incr | backup/git/ |
| 05:00 | Simple tar | backup/simple/ |
| Вс 03:00 | Restic prune | — |
# 1. Найти дамп
ls -la /mnt/beget-infra/dev-pro/backup/postgres/
# 2. Импортировать в контейнер
gunzip -c /mnt/beget-infra/dev-pro/backup/postgres/nocodb-products-db-*.sql.gz | \
docker exec -i nocodb-products-db psql -U nocodb
cd /mnt/beget-infra/dev-pro/backup/git/
# Найти последнюю неделю
ls -d week-* | sort -r | head -1
# Восстановить
git clone week-2025-51/full.bundle /opt/claude-workspace
cd /opt/claude-workspace
# Применить инкременты
for f in /mnt/beget-infra/dev-pro/backup/git/week-2025-51/incr-*.bundle; do
[ -f "$f" ] && git pull "$f" master
done
Последнее обновление: 2025-12-18