Files
2026-03-09 19:09:31 +07:00

30 lines
1.2 KiB
Markdown

cd /opt/telemt-plus
# 0) Остановить telemt перед переносом
docker compose stop telemt
# 1) Создать новую структуру
mkdir -p telemt-data/cache
# 2) Резервная копия текущих файлов
mkdir -p backup-telemt-$(date +%F-%H%M%S)
cp -a config.toml proxy-secret cache docker-compose.yml backup-telemt-$(date +%F-%H%M%S)/ 2>/dev/null || true
# 3) Перенос данных в telemt-data
[ -f config.toml ] && cp -f config.toml telemt-data/config.toml
[ -f proxy-secret ] && cp -f proxy-secret telemt-data/proxy-secret
[ -d cache ] && cp -a cache/. telemt-data/cache/
# 4) Права под пользователя контейнера telemt (uid/gid 999)
chown -R 999:999 telemt-data
find telemt-data -type d -exec chmod 750 {} \;
find telemt-data -type f -exec chmod 640 {} \;
chmod 660 telemt-data/config.toml 2>/dev/null || true
chmod 770 telemt-data/cache 2>/dev/null || true
# 5) Перезапуск контейнера после правки compose
docker compose up -d --force-recreate telemt
# 6) Проверка
docker logs --tail=100 telemt
docker exec telemt sh -lc 'ls -ld /run/telemt /run/telemt/cache; ls -l /run/telemt/config.toml'