/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/python/py-502-31-009/main.py
17 строк
519 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
import shutil from pathlib import Path def incremental_backup(src: Path, dst: Path) -> list[Path]: dst.mkdir(parents=True, exist_ok=True) copied = [] for f in src.rglob("*"): if not f.is_file(): continue rel = f.relative_to(src) target = dst / rel target.parent.mkdir(parents=True, exist_ok=True) if not target.exists() or f.stat().st_mtime > target.stat().st_mtime: shutil.copy2(f, target) copied.append(rel) return copied