根据事件触发将文件从共享点复制到谷歌云存储

问题描述 投票:0回答:1

我需要自动将文件从共享点复制到GCS:每次共享点中有新文件时,它都应该自动复制到GCS吗?有什么提示吗?

google-cloud-platform command-line-interface cron-task gcs
1个回答
0
投票

这不是一个明确的答案,但是,也许我们可以一起构建它

安装CloudQuery

curl -L https://github.com/cloudquery/cloudquery/releases/download/cli-v5.1.2/cloudquery_linux_amd64 -o cloudquery
chmod a+x cloudquery

创建源文件

sharepoint.yml

kind: source
spec:
  name: "sharepoint"
  registry: "github"
  path: "koltyakov/sharepoint"
  version: "v2.1.0" # provide the latest version
  destinations: ["gcs"] # the list of used destinations
  tables: ["*"] # required field, a list of tables to sync
  spec:
    auth:
      strategy: "ondemand"
      creds:
        siteUrl: "https://yoursubdomain.sharepoint.com/sites/yoursite"
    lists:
      Shared Documents:
        select:
          - File/Length
        expand:
          - File
        alias: "document"

然后是目标文件

kind: destination
spec:
  name: "gcs"
  path: "cloudquery/gcs"
  registry: "cloudquery"
  version: "v3.4.17"
  spec:
    bucket: "your-bucket"
    path: "path/to/dest/"
    format: "csv" # options: parquet, json, csv

您需要使用云身份验证连接到您的 GCS,以便您的凭据将在您的终端上可用

运行这个

cloudquery sync sharepoint.yml gcs.yml

Web 浏览器将提示您输入 SharePoint 凭据

使用此代码,您的 GCS 上将有 1 个或多个 CSV 文件,其中列出了来自 Sharepoint 的所有文件

从现在开始,这是我所能做的,但我认为我走在正确的道路上

© www.soinside.com 2019 - 2024. All rights reserved.