загрузить файл на гугл-диск, используя исполняемый cron python - PullRequest
0 голосов
/ 31 декабря 2018

Я успешно загрузил файл на диск Google следующим образом https://pythonhosted.org/PyDrive/quickstart.html, https://pythonhosted.org/PyDrive/oauth.html#automatic-and-custom-authentication-with-settings-yaml

, однако задание cron не смогло загрузить файл на диск Google через тот же файл.

вот мои настройки

скачать client_secrets.json

quickstart.py

from my drive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

gauth = GoogleAuth()
gauth.CommandLineAuth() # gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
.
.
def create_csv()
.
.
def upload()
.
.

settings.yaml

client_config_backend: settings
client_config:
  client_id: ***
  client_secret: ***
save_credentials: True
save_credentials_backend: file
save_credentials_file: credentials.json

get_refresh_token: True

oauth_scope:
  - https://www.googleapis.com/auth/drive.file
  - https://www.googleapis.com/auth/drive.install

почему cron работане работает?из-за OAuth?

спасибо

...