Created
October 17, 2024 10:59
-
-
Save bbq-all-stars/531ddf1a5fd6b3d19e6d5b6240c80d18 to your computer and use it in GitHub Desktop.
Movable Type クラウド版に rclone でファイルをアップロードする時のオプション
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail # これがないとrcloneでエラーが起きてもCIがエラーにならない | |
# 初期設定 | |
export RCLONE_FTP_HOST=${DEPLOY_HOST} | |
export RCLONE_FTP_USER=${DEPLOY_USER} | |
export RCLONE_FTP_PASS=$(echo "$DEPLOY_PASS" | rclone obscure -) | |
export RCLONE_FTP_NO_CHECK_CERTIFICATE=true | |
export RCLONE_FTP_EXPLICIT_TLS=true | |
export RCLONE_FTP_WRITING_MDTM=true # これがないと sync で新しいファイルがアップロードされない | |
export RCLONE_FTP_DISABLE_TLS13=true # これがないと 426 Failure reading network stream. みたいなエラーが頻発してまともにファイルをアップロードできない | |
export RCLONE_FTP_CONCURRENCY=2 # この数字が大きいと ERROR : file.txt: Failed to copy: Put mkParentDir failed: mkdir "/dir" failed: local error: tls: protocol version not supported みたいなエラーが出る | |
# アップロード | |
rclone sync --dry-run "/${LOCAL_DIR}/" ":ftp:/${REMOTE_DIR}/" --verbose --delete-excluded --exclude='.*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment