Command sync needs 2 arguments Google Drive

I’m having trouble running a .sh file in python. When I type in the location of the .sh file (/home/pi/dir/script.sh) the script runs perfectly.

I’m trying to run this script in my python2 script and I’ve done the following methods:

subprocess.Popen(['bash', 'location of .sh'])
subprocess.call(['location of .sh'])
os.popen(['location of .sh'])

When I run the python script, I get a prompt from rclone saying “Command sync needs 2 arguments maximum”

My .sh file just includes:

#!/bin/sh
sudo /usr/local/bin/rclone -v sync /home/pi/some_project_data remote:rclone --delete-before --include *.csv --include *.py

I’m not sure how running the .sh file on terminal works fine, but this error pops up when I’m trying to run the .sh file using Python or when I run ./script.sh in terminal (also says needs 2 arguments). Isn’t include one of the arguments?

I think you need to quote the wildcards - if there are .csv files in the directory that you run this shell script from then things will go wrong… So

sudo /usr/local/bin/rclone -v sync /home/pi/some_project_data remote:rclone --delete-before --include "*.csv" --include "*.py"

Or maybe

sudo /usr/local/bin/rclone -v sync /home/pi/some_project_data remote:rclone --delete-before --include "*.{csv,py}"
1 Like

Yes I think this fixed it. However there is another problem that arises, it reads:

"Config file “/root/.config/rclone/rclone.conf” not found -using defaults then \\ Failed to create file system for “remote:rclone”: didn’t find section in config file –

any clue what this might be?

That is saying rclone can’t find its config file. Did you configure it as a different user? If so then either run it as that user or use --config /home/OTHERUSER/.config/rclone/rclone.conf