Skip to content

Commit

Permalink
Add an option to use rclone copy with sync
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Mar 15, 2024
1 parent 93a522e commit 2ce17a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cm-mlops/script/download-file/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"tags": "detect,os"
}
],
"env": {},
"default_env": {
"CM_RCLONE_COPY_USING": "sync"
},
"input_description": {},
"input_mapping": {
"download_path": "CM_DOWNLOAD_PATH",
Expand Down
3 changes: 2 additions & 1 deletion cm-mlops/script/download-file/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def preprocess(i):
elif tool == "rclone":
if env.get('CM_RCLONE_CONFIG_CMD', '') != '':
env['CM_DOWNLOAD_CONFIG_CMD'] = env['CM_RCLONE_CONFIG_CMD']
env['CM_DOWNLOAD_CMD'] = f"rclone sync {url} {os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])} -P"
rclone_copy_using = env.get('CM_RCLONE_COPY_USING', 'sync')
env['CM_DOWNLOAD_CMD'] = f"rclone {rclone_copy_using} {url} {os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])} -P"

filename = env['CM_DOWNLOAD_FILENAME']
env['CM_DOWNLOAD_DOWNLOADED_FILENAME'] = filename
Expand Down

0 comments on commit 2ce17a7

Please sign in to comment.