Aim
- We want to upload file to google drive by command line on ubuntu 18.04 server
Steps
- Install gdrive
# Install gdrive $ wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download $ mv uc\?id\=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive $ chmod +x gdrive $ sudo install gdrive /usr/local/bin/gdrive
- Connect gdrive to your google drive
# Connect gdrive with google drive, just use any command, for example $ gdrive list # Follow the steps suggested by gdrive # You can find the token file from $ ls ~/.gdrive
- Normal use case
# After that you can upload file to target folder, you can list and see the location $ gdrive list $ gdrive upload --parent die231 backup.txt
沒有留言:
發佈留言