git clone https://github.com/bachvtuan/Backup-To-Google-Drive.git
pip install --upgrade google-api-python-client
pip install --upgrade oauth2client==1.5.2
pip install PyOpenSSL
you create your google drive api first at
Link.
After google drive project is created, You go to
API & Auth tab and click on
Credentials. From here, click on button with label
Create new Client ID and select
service account and click on
Create Client ID button , after created service account, you download the private key to somewhere such as I put at path "configs/74214843aee8aba9f11b7825e0a22ef1f06533b7-privatekey.p12" and copy service account id such as "
xxxxx-5kfab22qfu82uub2887gi0c9e6eincmu@developer.gserviceaccount.com"
-
Create config file( such as config_file.json ) and input into this file with json format such as
{
"service_account":"xxxxx-5kfab22qfu82uub2887gi0c9e6eincmu@developer.gserviceaccount.com",
"private_key12_path":"configs/74214843aee8aba9f11b7825e0a22ef1f06533b7-privatekey.p12",
"backup_folder_id":"0B0XTTQmH9aXreFdxS0txVU5Xb1U",
"description" : "Description for backup file",
"max_file_in_folder": 5
}
Không có nhận xét nào:
Đăng nhận xét