34

We have Centos, there is a directory with sql backups. How we can send those backups to Google Drive using cron schedule?

3 Answers 3

8

The hack is to use Google Colab then mount google drive to it. After that, you can use ssh to access google collab file system as well as access mounted google drive.

I have written a python notebook here and tried it with success. https://gist.github.com/bikcrum/f9d4cfb0c40dff23329b89cd664d4964

Sign up to request clarification or add additional context in comments.

Comments

5

GDCP should work as long as you authenticate the user for cron with the interactive cli.

https://github.com/ctberthiaume/gdcp

... I am using this now to transfer thousands of mp3 files from a ubuntu vps to google drive.

2 Comments

Any version of GDCP for windows ?
This script is 4 years old as of this writing and the install instructions don't work for me. I think Google API changed its tool causing an incompatiblity
-3

I was able to do it thanks to the paramiko package:

!pip install paramiko 
import paramiko ssh = paramiko.SSHClient() # automatically add keys without requiring human intervention ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(url, port, username, password) ftp_client = ssh.open_sftp() ftp_client.get('/home/covam/CEMAI/data/results/output1805to0206_rawShiptype.csv', 'data.csv') ftp_client.close() ssh.close() 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.