{"id":24929796,"url":"https://github.com/traptitech/localfile-backup-helper","last_synced_at":"2025-03-28T13:28:57.059Z","repository":{"id":45255177,"uuid":"383145257","full_name":"traPtitech/localfile-backup-helper","owner":"traPtitech","description":"ローカルファイルのバックアップスクリプト","archived":false,"fork":false,"pushed_at":"2022-05-10T01:21:00.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T22:14:18.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traPtitech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-05T13:10:00.000Z","updated_at":"2022-01-15T09:49:35.000Z","dependencies_parsed_at":"2022-09-10T05:51:06.774Z","dependency_job_id":null,"html_url":"https://github.com/traPtitech/localfile-backup-helper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Flocalfile-backup-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Flocalfile-backup-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Flocalfile-backup-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Flocalfile-backup-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traPtitech","download_url":"https://codeload.github.com/traPtitech/localfile-backup-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246036822,"owners_count":20713300,"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","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":[],"created_at":"2025-02-02T13:51:54.090Z","updated_at":"2025-03-28T13:28:57.038Z","avatar_url":"https://github.com/traPtitech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# localfile-backup-helper\n\nローカルファイルのバックアップ用スクリプト  \nローカルストレージ上の任意のフラットなディレクトリからデータをコピーし、GCP Storage にバックアップします。  \n※ 月一ペースで叩くことを想定したコードを想定しています。それ以外の場合は修正が必要です。  \n※ 指定されたディレクトリ内にサブディレクトリがあった場合、挙動が予期しないものになる可能性があります。\n\n## 設定\n\n環境変数を必ず指定してください。\n\n- ローカル関連\n  - `LOCAL_PATH`  \n    バックアップしたいローカルディレクトリのパス\n- GCP 関連\n  - `GOOGLE_APPLICATION_CREDENTIALS`  \n    GCP の、バックアップ先のプロジェクトに紐づけられたサービスアカウントのキー(json ファイル)のパス\n  - `PROJECT_ID`  \n    バックアップ先のバケットを作成するプロジェクトの id\n  - `BUCKET_NAME`  \n    バックアップ先のバケットの名前\n    小文字・数字・記号が使えますが大文字が使えません\n  - `STORAGE_CLASS`  \n    データを格納するバケットのストレージクラス\n  - `DURATION`  \n    単一バージョンを保存する期間 (日数指定)\n  - `PARALLEL_NUM`  \n    同時にバックアップするファイル数\n- traQ Webhook Bot 関連\n  - `TRAQ_WEBHOOK_ID`  \n    traQ Webhook Bot の ID\n  - `TRAQ_WEBHOOK_SECRET`  \n    traQ Webhook Bot のシークレット\n\n## ローカルで動かす場合\n\nシェルスクリプトで動かします。  \nこのリポジトリをクローンしたディレクトリ直下に下のような内容で任意の sh ファイルを作り、コンソールから`sh xxx.sh`で実行してください\n\n```sh xxx.sh\n#!/bin/sh\n\n# 環境変数の設定\nexport LOCAL_PATH={path}\nexport GOOGLE_APPLICATION_CREDENTIALS={path}\nexport PROJECT_ID={project-id}\nexport BUCKET_NAME={name}\nexport STORAGE_CLASS={storage-class}\nexport DURATION={duration}\nexport PARALLEL_NUM={number}\nexport TRAQ_WEBHOOK_ID={id}\nexport TRAQ_WEBHOOK_SECRET={secret}\n\ngo run *.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraptitech%2Flocalfile-backup-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraptitech%2Flocalfile-backup-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraptitech%2Flocalfile-backup-helper/lists"}