Reolink Remote Backup
Implement resilient backup using:
- 1. Reolink camera FTP/FTPS upload -> VPS relay
- Local machine pull from VPS -> NAS/local archive
- Retention + health checks
Use this flow when direct camera->home ingest is impractical.
Inputs to collect
- - Camera model + hardware version
- Whether FTP/FTPS options are visible in app/client
- VPS host/IP and SSH access method
- Local destination path (NAS mountpoint)
- Desired pull interval (default 10 min)
- Desired VPS retention window (default 30 days)
Workflow
1) Validate architecture constraints
- - If home inbound routing is locked/CGNAT, prefer VPS relay.
- Keep NAS off public internet.
- Use local pull from VPS (never rely on VPS pushing into home NAT).
2) Configure VPS ingest
Run scripts/setup_vps_vsftpd.sh on VPS as root. It:
- - installs vsftpd + ufw
- creates
reolinkftp ingest user - sets up INLINECODE2
- opens SSH + FTP passive ports
Then set camera FTP/FTPS target to VPS.
3) Configure local pull
Run scripts/setup_local_pull.sh on local machine. It writes:
- - INLINECODE4
- systemd user service + timer with INLINECODE5
This ensures catch-up after downtime.
4) Set retention safety
Run scripts/setup_vps_retention.sh on VPS to prune old files if local sync is offline for prolonged periods.
5) Verify
- - Trigger camera upload or run camera FTP test.
- Confirm files appear on VPS: INLINECODE7
- Run local pull script once manually.
- Confirm files appear on destination path.
- Confirm timer active: INLINECODE8
Troubleshooting
Read references/troubleshooting.md for response-code and log-driven fixes.
Fast checks:
- - VPS service status: INLINECODE10
- VPS logs: INLINECODE11
- FTP logs: INLINECODE12
- Mount status (local): INLINECODE13
Security baseline
- - Use SSH keys for VPS admin access.
- Keep FTP user isolated from admin users.
- Prefer FTPS after initial debugging.
- Enforce retention so VPS disk cannot fill.
- Rotate any credential exposed in chat/logs.
Reolink 远程备份
使用以下方法实现弹性备份:
- 1. Reolink 摄像头 FTP/FTPS 上传 -> VPS 中继
- 本地机器从 VPS 拉取 -> NAS/本地归档
- 保留策略 + 健康检查
当摄像头直连家庭网络不可行时,请使用此流程。
需收集的输入信息
- - 摄像头型号 + 硬件版本
- 应用/客户端中是否可见 FTP/FTPS 选项
- VPS 主机/IP 及 SSH 访问方式
- 本地目标路径(NAS 挂载点)
- 期望的拉取间隔(默认 10 分钟)
- 期望的 VPS 保留窗口(默认 30 天)
工作流程
1) 验证架构限制
- - 如果家庭入站路由被锁定或使用 CGNAT,优先选择 VPS 中继。
- 保持 NAS 不暴露于公网。
- 使用从 VPS 的本地拉取(切勿依赖 VPS 推送到家庭 NAT)。
2) 配置 VPS 接收
以 root 身份在 VPS 上运行 scripts/setupvpsvsftpd.sh。该脚本会:
- - 安装 vsftpd + ufw
- 创建 reolinkftp 接收用户
- 设置 /srv/reolink/incoming
- 开放 SSH + FTP 被动端口
然后将摄像头 FTP/FTPS 目标设置为 VPS。
3) 配置本地拉取
在本地机器上运行 scripts/setuplocalpull.sh。该脚本会写入:
- - /home/$USER/bin/reolink_pull.sh
- 启用 Persistent=true 的 systemd 用户服务及定时器
这确保了停机后的数据补拉。
4) 设置保留安全策略
在 VPS 上运行 scripts/setupvpsretention.sh,以便在本地同步长时间离线时清理旧文件。
5) 验证
- - 触发摄像头上传或运行摄像头 FTP 测试。
- 确认文件出现在 VPS 上:/srv/reolink/incoming
- 手动运行一次本地拉取脚本。
- 确认文件出现在目标路径。
- 确认定时器已激活:systemctl --user list-timers | grep reolink-pull
故障排除
阅读 references/troubleshooting.md 获取基于响应码和日志的修复方案。
快速检查:
- - VPS 服务状态:systemctl status vsftpd
- VPS 日志:journalctl -u vsftpd -n 120 --no-pager
- FTP 日志:tail -n 120 /var/log/vsftpd.log
- 挂载状态(本地):mountpoint -q <挂载路径>
安全基线
- - 使用 SSH 密钥进行 VPS 管理访问。
- 保持 FTP 用户与管理员用户隔离。
- 初始调试后优先使用 FTPS。
- 强制执行保留策略,防止 VPS 磁盘填满。
- 轮换任何在聊天/日志中暴露的凭证。