From e2be54eb60c26357bda3a4cd99e49ed1e8e93321 Mon Sep 17 00:00:00 2001 From: Mads Engel Lundt Date: Tue, 22 Aug 2017 11:22:08 +0200 Subject: [PATCH] Rclone Copy/Move makes use of more option flags --- README.md | 2 +- config | 5 +++-- scripts/cloudupload | 2 +- scripts/mount.remote | 2 +- scripts/rmlocal | 4 ++-- setup.sh | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0e016f6..1b630de 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ To install the necessary stuff manually do the following: 4. Install [Rclone 1.36](https://downloads.rclone.org/rclone-current-linux-amd64.zip). 5. Install [Plexdrive 4.0.0](https://github.com/dweidenfeld/plexdrive/releases/download/4.0.0/plexdrive-linux-amd64). 6. Create the folders pointing, in the config file, to `local_decrypt_dir` and `plexdrive_temp_dir`. -7. Run rclone bin, installed in step 4, with the parameter `--config=RCLONE_CFG config` where `RCLONE_CFG` is the variable set in the config file. +7. Run rclone bin, installed in step 4, with the parameter `--config=RCLONE_CONFIG config` where `RCLONE_CONFIG` is the variable set in the config file. 8. Set up Google Drive remote, Crypt for Google Drive remove (rclone_cloud_endpoint) and crypt for local directory (rclone_local_endpoint). 9. Run plexdrive bin, installed in step 5, with the parameters `--config=PLEXDRIVE_DIR --mongo-database=MONGO_DATABASE --mongo-host=MONGO_HOST --mongo-user=MONGO_USER --mongo-password=MONGO_PASSWORD`. Remember to match the parameters with the variables in the config file. 10. Enter authorization to your Google Drive. diff --git a/config b/config index 1715dc9..5198f89 100644 --- a/config +++ b/config @@ -45,8 +45,9 @@ plexdrive_options="--temp=${plexdrive_temp_dir} -o allow_other --clear-chunk-max rclone_dir="${media_dir}/rclone" rclone_bin="${rclone_dir}/rclone" -rclone_cfg="${rclone_dir}/rclone.conf" -rclone_options="--read-only --allow-non-empty --allow-other --buffer-size 500M --max-read-ahead 30G --checkers 16" +rclone_config="${rclone_dir}/rclone.conf" +rclone_options="${rclone_config} --buffer-size 500M --checkers 16" +rclone_mount_options="${rclone_options} --read-only --allow-non-empty --allow-other --max-read-ahead 30G" # Rclone endpoints rclone_cloud_endpoint="gd-crypt:" diff --git a/scripts/cloudupload b/scripts/cloudupload index e6a1f23..a306a08 100644 --- a/scripts/cloudupload +++ b/scripts/cloudupload @@ -42,7 +42,7 @@ find "${local_decrypt_dir}" -type f | # Copy file to remote destination[s], retaining path echo "[ $(date ${date_format}) ] Transfering file -> ${n} to Google Drive in ${destpath}." - "${rclone_bin}" copy --config="${rclone_cfg}" "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 + "${rclone_bin}" copy $rclone_options "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 done # success! diff --git a/scripts/mount.remote b/scripts/mount.remote index 9f664fd..adcff7e 100644 --- a/scripts/mount.remote +++ b/scripts/mount.remote @@ -47,7 +47,7 @@ mount_local_media () { if ! mountpoint -q "$cloud_decrypt_dir"; then echo "[ $(date ${date_format}) ] Mounting decrypted Google Drive: ${cloud_decrypt_dir}" - "${rclone_bin}" mount --config="${rclone_cfg}" $rclone_options "${rclone_local_endpoint}" "${cloud_decrypt_dir}" >/dev/null 2>&1 + "${rclone_bin}" mount $rclone_mount_options "${rclone_local_endpoint}" "${cloud_decrypt_dir}" >/dev/null 2>&1 else echo "[ $(date ${date_format}) ] Decrypted Google Drive mountpoint: ${cloud_decrypt_dir} already mounted." fi diff --git a/scripts/rmlocal b/scripts/rmlocal index 7b0ce17..f5a72aa 100644 --- a/scripts/rmlocal +++ b/scripts/rmlocal @@ -37,7 +37,7 @@ rm_time () { # Move file to remote destination[s], retaining path echo "[ $(date ${date_format}) ] Moving file -> ${n} to Google Drive." - "${rclone_bin}" move --config="${rclone_cfg}" "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 + "${rclone_bin}" move $rclone_options "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 done } @@ -91,7 +91,7 @@ rm_space () { # Move file to remote destination[s], retaining path echo "[ $(date ${date_format}) ] Moving file -> ${n} to Google Drive. Freeing up ${fileSizeGb} GB" - "${rclone_bin}" move --config="${rclone_cfg}" "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 + "${rclone_bin}" move $rclone_options "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 done } diff --git a/setup.sh b/setup.sh index fede83f..fb40c84 100644 --- a/setup.sh +++ b/setup.sh @@ -53,7 +53,7 @@ fi echo "\n\n--------- SETUP RCLONE ----------\n" echo "1. Now run rclone with the command:" -echo "\t${rclone_bin} --config=${rclone_cfg} config" +echo "\t${rclone_bin} --config=${rclone_config} config" echo "2. You need to setup following:" echo "\t- Google Drive remote" echo "\t- Crypt for your Google Drive remote named '${rclone_cloud_endpoint%?}'"