A python script lists Which Use Service Account to bypass the 750G upload file size limit on Google Drive based on folderclone
Different from The exist project, This repo use Rclone to transfer files from local disk to Google Drive or Team Drive.
- Python ^3.4 (Use 64-Bit Python only)
- Python Library which list in
requirements.txt
- Rclone ^1.41 (To support
service_account_credentials
feature )
Chinese Version: 使用Service Account突破rclone单账号GD每日750G上传限制
-
setup
multifactory.py
- Head over to https://console.developers.google.com/ and sign in with your account.
- Click "Library" on the left column, then click on "Select a project" at the top. Click on
NEW PROJECT
on the top-right corner of the new window. - In the Project name section, input a project name of your choice. Wait till the project creation is done and then click on "Select a project" again at the top and select your project.
- Select "OAuth consent screen" and fill out the Application name field with a name of your choice. Scroll down and hit "Save"
- Select "Credentials" and select Create credentials. Choose "OAuth client ID". Choose "Other" as your Application type and hit "Create". Hit "Ok". You will now be presented with a list of "OAuth 2.0 client IDs". At the right end, there will be a download icon. Select it to download and save it as
credentials.json
in the script folder. - Find out how many projects you'll need. For example, a 100 TB job will take approximately 135 service accounts to make a full clone. Each project can have a maximum of 100 service accounts. In the case of the 100TB job, we will need 2 projects.
multifactory.py
conveniently includes a quick setup option. Run the following commandpython3 multifactory.py --quick-setup N
. ReplaceN
with the amount of projects you need!. If you want to only use new projects instead of existing ones, make sure to add--new-only
flag. It will automatically start doing all the hard work for you. 6a) Running this for the first time will prompt you to login with your Google account. Login with the same account you used for Step 1. If will then ask you to enable a service. Open the URL in your browser to enable it. Press Enter once it's enabled.
-
Steps to add all the service accounts to the Shared Drive
- Once
multifactory.py
is done making all the accounts, open Google Drive and make a new Shared Drive to copy to. - Run the following command
python3 masshare.py -d SDFolderID
. Replace theSDFolderID
withXXXXXXXXXXXXXXXXXXX
. The Folder ID can be obtained from the Shared Drive URLhttps://drive.google.com/drive/folders/XXXXXXXXXXXXXXXXXXX
.masshare.py
will start adding all your service accounts.
- Once
-
Steps for
autorclone.py
- Change script config at the beginning of file.
- Run it manually in
screen
or Add to crontab like0 */1 * * * /usr/bin/python3 /path/to/autorclone.py