20240222190405 Raspi4でDropboxを使う

Raspi4でrcloneを使うの方法を推奨。こっちは遅いしイマイチ。

Arm64 linuxは公式には対応していない。 Dropbox-Uploader というbash scriptを使う。

$ git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
$ cd Dropbox-Uploader/
$ ls
CHANGELOG.md  Dockerfile.pi        dropShell.sh  README.md
Dockerfile    dropbox_uploader.sh  LICENSE       testUnit.sh

ここに入っている dropbox_updloader.shを実行してみると、指示が表示される。その通りにやる。 App nameはこのnoteの同期用なので、 “kazbo_note_sync” にした。 3) Choose the type of access you need: App folder" の所は、全体的に使いたいので、 Full Dropboxを選択。

$ ./dropbox_uploader.sh

 This is the first time you run this script, please follow the instructions:

(note: Dropbox will change their API on 2021-09-30.
When using dropbox_uploader.sh configured in the past with the old API, have a look at README.md, before continue.)

 1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps
 2) Click on "Create App", then select "Choose an API: Scoped Access"
 3) "Choose the type of access you need: App folder"
 4) Enter the "App Name" that you prefer (e.g. MyUploader68212467426140), must be unique

 Now, click on the "Create App" button.

 5) Now the new configuration is opened, switch to tab "permissions" and check "files.metadata.read/write" and "files.content.read/write"
 Now, click on the "Submit" button.

 6) Now to tab "settings" and provide the following information:
 App key: ****
 App secret: ****
  Open the following URL in your Browser and allow suggested permissions: https://www.dropbox.com/oauth2/authorize****
  
 Please provide the access code: *****

 > App key: ********
 > App secret: '****
 > Access code: '*****'. Looks ok? [y/N]: y
   The configuration has been saved.
$ 
$ ./Dropbox-Uploader/dropbox_uploader.sh  list /
> Listing "/"... DONE
 [D]          hoge
 [D]          fuga
 [D]          ...

などと表示されたので良さそう。 このトークンが12時間とかで切れないかは確認していない。 使い方は以下の感じ。

 $ ./Dropbox-Uploader/dropbox_uploader.sh
Dropbox Uploader v1.0
Andrea Fabrizi - [email protected]

Usage: ./Dropbox-Uploader/dropbox_uploader.sh [PARAMETERS] COMMAND...

Commands:
         upload   <LOCAL_FILE/DIR ...>  <REMOTE_FILE/DIR>
         download <REMOTE_FILE/DIR> [LOCAL_FILE/DIR]
         delete   <REMOTE_FILE/DIR>
         move     <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
         copy     <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
         mkdir    <REMOTE_DIR>
         list     [REMOTE_DIR]
         monitor  [REMOTE_DIR] [TIMEOUT]
         share    <REMOTE_FILE>
         saveurl  <URL> <REMOTE_DIR>
         search   <QUERY>
         info
         space
         unlink

Optional parameters:
        -f <FILENAME> Load the configuration file from a specific file
        -s            Skip already existing files when download/upload. Default: Overwrite
        -d            Enable DEBUG mode
        -q            Quiet mode. Don't show messages
        -h            Show file sizes in human readable format
        -p            Show cURL progress meter
        -k            Doesn't check for SSL certificates (insecure)
        -x            Ignores/excludes directories or files from syncing. -x filename -x directoryname. example: -x .git

For more info and examples, please see the README file.

cf. 第54回「SORACOM応用編!ラズベリーパイからDropboxへファイルをアップロード(1)Dropbox-Uploader」 | Device Plus - デバプラ