{"id":20636491,"url":"https://github.com/hazelnutparadise/goback2onedrive","last_synced_at":"2026-05-18T00:04:24.578Z","repository":{"id":253891974,"uuid":"844843971","full_name":"HazelnutParadise/GoBack2Onedrive","owner":"HazelnutParadise","description":"Auto backup files to Onedrive.","archived":false,"fork":false,"pushed_at":"2024-12-17T15:32:22.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T08:39:33.622Z","etag":null,"topics":["backup","docker-compose","golang","onedrive"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HazelnutParadise.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-20T04:38:57.000Z","updated_at":"2024-12-17T15:32:26.000Z","dependencies_parsed_at":"2025-01-17T08:10:43.820Z","dependency_job_id":"88fe730c-a4df-4c55-ac56-4e6cc1f18e34","html_url":"https://github.com/HazelnutParadise/GoBack2Onedrive","commit_stats":null,"previous_names":["hazelnutparadise/goback2onedrive"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HazelnutParadise/GoBack2Onedrive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazelnutParadise%2FGoBack2Onedrive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazelnutParadise%2FGoBack2Onedrive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazelnutParadise%2FGoBack2Onedrive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazelnutParadise%2FGoBack2Onedrive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HazelnutParadise","download_url":"https://codeload.github.com/HazelnutParadise/GoBack2Onedrive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HazelnutParadise%2FGoBack2Onedrive/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267600260,"owners_count":24113746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","docker-compose","golang","onedrive"],"created_at":"2024-11-16T15:11:06.034Z","updated_at":"2026-05-18T00:04:19.540Z","avatar_url":"https://github.com/HazelnutParadise.png","language":"Go","funding_links":["https://www.paypal.me/tingzhen666"],"categories":[],"sub_categories":[],"readme":"# GoBack2Onedrive: Auto backup files to Onedrive.\r\n\r\nGoBack2Onedrive 是一個使用 Go 語言編寫的工具，能夠將指定的資料夾壓縮成ZIP文件後上傳到 OneDrive，並且可以根據配置自動清理舊的備份文件。該工具支持分塊上傳大文件，並且會在上傳過程中自動重試直到成功。此工具可以配置為在 Docker 容器中運行，並通過 Docker Compose 定期執行備份操作。\r\n\r\n### 贊助我：[PayPal](https://www.paypal.me/tingzhen666)\r\n\r\n## 功能特點\r\n\r\n- 自動壓縮資料夾並上傳到 OneDrive。\r\n- 支援分塊上傳大文件。\r\n- 根據配置自動清理舊的備份文件。\r\n- 上傳失敗自動重試直到成功。\r\n- 上傳成功後自動清空本地的備份文件。\r\n\r\n## 安裝\r\n\r\n1. **克隆倉庫：**\r\n\r\n   ```bash\r\n   git clone https://github.com/HazelnutParadise/GoBack2Onedrive.git\r\n   cd GoBack2Onedrive\r\n   ```\r\n\r\n2. **構建 Docker 映像：**\r\n\r\n   在項目根目錄下運行以下命令來構建 Docker 映像：\r\n\r\n   ```bash\r\n   docker build -t goback2onedrive:latest .\r\n   ```\r\n\r\n3. **配置 Docker Compose：**\r\n\r\n   建立 `docker-compose.yml` 文件（內容可參考docker-compose-demo.yml），設置需要備份的資料夾路徑以及 OneDrive API 的相關環境變數。\r\n\r\n## 使用\r\n\r\n1. **環境變數設置：**\r\n\r\n   在 `docker-compose.yml` 文件中，設置以下環境變數：\r\n\r\n   - `CLIENT_ID`: 你的 OneDrive 應用程式的客戶端 ID。\r\n   - `CLIENT_SECRET`: 你的 OneDrive 應用程式的客戶端密鑰。\r\n   - `TENANT_ID`: 你的 OneDrive 租戶 ID。\r\n   - `DRIVE_ID`: 你的 OneDrive 驅動器 ID。\r\n   - `ONEDRIVE_DESTINATION_FOLDER`: 備份文件上傳到 OneDrive 的目標資料夾。\r\n   - `MAX_BACKUPS`: 要在 OneDrive 保留的最大備份數量。\r\n\r\n2. **運行 Docker Compose：**\r\n\r\n   使用以下命令來運行容器並啟動備份任務：\r\n\r\n   ```bash\r\n   docker-compose up -d\r\n   ```\r\n\r\n   此命令將根據 `docker-compose.yml` 中的配置定期進行備份並上傳到 OneDrive。\r\n\r\n3. **檢查日誌：**\r\n\r\n   如果需要查看容器的日誌，可以運行以下命令：\r\n\r\n   ```bash\r\n   docker logs -f goback2onedrive-backup\r\n   ```\r\n\r\n4. **清理本地備份文件：**\r\n\r\n   程式會自動在成功上傳後清理 `/app/backups` 資料夾中的本地備份文件。\r\n\r\n## 文件結構\r\n\r\n- `GoBack2Onedrive.go`: 主程式文件，包含壓縮、上傳和清理備份的邏輯。\r\n- `Dockerfile`: 定義了如何構建 GoBack2Onedrive 的 Docker 映像。\r\n- `docker-compose.yml`: 用於配置和管理 Docker 容器的 Compose 文件。\r\n\r\n## 貢獻\r\n\r\n如果你有任何想法或問題，歡迎提交 issue 或 pull request。\r\n\r\n## 許可證\r\n\r\n這個專案使用 [MIT 許可證](LICENSE)。\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazelnutparadise%2Fgoback2onedrive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazelnutparadise%2Fgoback2onedrive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazelnutparadise%2Fgoback2onedrive/lists"}