Check sa validity script speed

What is the problem you are having with rclone?

I hope to check the availability of Google's SA account through the rclone lsd command.But the failure of the failure of the SA is too slow, what parameters need to be added

Run the command 'rclone version' and share the full output of the command.

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

do_sumnum=0
for sa_path in $(find $safolder -type f -name "*.json")
do
  n=1
  do_sumnum=$((do_sumnum+1))
  do_per=`awk 'BEGIN{printf "%.1f%%\n",('$do_sumnum'/'$sa1_sum')*100}'`
  echo -e "testing $sa_path ,$do_sumnum, total $sa1_sum,percent $do_per"
  rclone lsd "$fclone_name1": --drive-root-folder-id "$fsa_id" --drive-service-account-file="$sa_path"
  if [ $? -eq 0 ]; then
    echo &> /dev/null
  else
    echo -e "$sa_path test NG, move to $safolder/invalid"
    mv -f $sa_path $safolder/invalid
  fi
done

The rclone config contents with secrets removed.


A log from the command with the -vv flag

/home/vps_sa/frreq_sa/frreqc5@sauser42.json检测NG,即将移至/home/vps_sa/frreq_sa/invalid
正在检测/home/vps_sa/frreq_sa/frreqc5@sauser43.json ,第2553个,共计10000,完成进度25.5%
2022/02/16 10:53:26 ERROR : : error listing: couldn't list directory: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded
2022/02/16 10:53:26 Failed to lsd with 2 errors: last error was: couldn't list directory: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded

Are you just checking to see if the credentials are valid or not?

If so you could try rclone about drive: which is much faster than listing the directory with rclone lsd drive:.

Unfortunately, use "rclone about remote: --drive-service-account-file=/home/vps_sa/123@456.json",invalid SA will still display 0

You'll actually have to do the list then if you are interested in those 403 errors.

You can reduce --low-level-retries to make the error come quicker, but note that some level of retries is normal with google drive so don't make it too small otherwise you'll get false positives.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.