Skip to content

Commit

Permalink
Improve RCLONE environment variable file loading method
Browse files Browse the repository at this point in the history
  • Loading branch information
P3TERX committed Nov 26, 2020
1 parent 114c5c0 commit abb8f8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions rclone.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@
# https://github.com/P3TERX/aria2.conf
# File name:rclone.env
# Description: Rclone environment variables file
# Version: 2020.07.05
# Version: 2020.11.26
#

# RCLONE 配置文件路径
#export RCLONE_CONFIG=$HOME/.config/rclone/rclone.conf
#RCLONE_CONFIG=$HOME/.config/rclone/rclone.conf

# RCLONE 配置文件密码
#export RCLONE_CONFIG_PASS=
#RCLONE_CONFIG_PASS=

# RCLONE 并行上传文件数,仅对单个任务有效
#export RCLONE_TRANSFERS=4
# RCLONE 并行上传文件数,使用 Aria2 联动上传时仅适用于单个任务
#RCLONE_TRANSFERS=4

# RCLONE 缓存大小。默认:16M
# 理论上此项值越大文件传输速度越快。每个并行任务都将占用此大小的内存进行缓存,根据实际内存大小合理设置,设置得太大可能会导致进程中断。
#export RCLONE_BUFFER_SIZE=16M
#RCLONE_BUFFER_SIZE=16M

# RCLONE 上传失败重试次数,默认:3
#export RCLONE_RETRIES=3
#RCLONE_RETRIES=3

# RCLONE 上传失败重试等待时间(s, m, h),默认禁用
export RCLONE_RETRIES_SLEEP=10s
RCLONE_RETRIES_SLEEP=10s

# RCLONE 跳过错误继续上传。默认:false
#export RCLONE_IGNORE_ERRORS=true
#RCLONE_IGNORE_ERRORS=true

# RCLONE 跳过已经存在的文件。默认:false
#export RCLONE_IGNORE_EXISTING=true
#RCLONE_IGNORE_EXISTING=true

# RCLONE 实时显示传输进度,否则每分钟显示一次。默认:false
#export RCLONE_PROGRESS=true
# RCLONE 实时显示传输进度。默认:false(每分钟显示一次)
#RCLONE_PROGRESS=true

# RCLONE 代理设置
#export HTTP_PROXY=localhost:1080
#export HTTPS_PROXY=$HTTP_PROXY
#HTTP_PROXY=localhost:1080
#HTTPS_PROXY=$HTTP_PROXY

# More details
# https://rclone.org/docs/#environment-variables
4 changes: 2 additions & 2 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# https://github.com/P3TERX/aria2.conf
# File name:upload.sh
# Description: Use Rclone to upload files after Aria2 download is complete
# Version: 3.0
# Version: 3.1
#

CHECK_CORE_FILE() {
Expand Down Expand Up @@ -72,7 +72,7 @@ DEFINITION_PATH() {

LOAD_RCLONE_ENV() {
RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env"
[[ -f ${RCLONE_ENV_FILE} ]] && . ${RCLONE_ENV_FILE}
[[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0)
}

UPLOAD_FILE() {
Expand Down

0 comments on commit abb8f8e

Please sign in to comment.