- 使用 mongodump 导出 mongodb 数据
- 使用 gpg 加密导出的数据
- 将加密数据上传到阿里云对象存储服务
# 每天凌晨4点从服务器上传备份数据到阿里OSS
00 4 * * * /root/mongodb-backup/dump-data.sh && /root/mongodb-backup/encrypt-data.sh && docker restart mongodb-backup && sleep 1m && curl http://127.0.0.1:9160/upload
# 每周六12点从阿里云OSS将备份数据下载到本地
0 12 * * 6 curl http://127.0.0.1:9160/download