Skip to content

Commit

Permalink
Rclone Copy/Move makes use of more option flags
Browse files Browse the repository at this point in the history
  • Loading branch information
madslundt committed Aug 22, 2017
1 parent 6c1c2b2 commit e2be54e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
2 changes: 1 addition & 1 deletion scripts/cloudupload
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion scripts/mount.remote
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/rmlocal
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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%?}'"
Expand Down

0 comments on commit e2be54e

Please sign in to comment.