发新话题
打印

[Linux] gdrive上传文件,同步目录到google drive

本主题由 3sv 于 2019-7-4 02:38 PM 分类 本主题被作者加入到个人文集中

gdrive上传文件,同步目录到google drive

上传本地单个文件到网盘指定目录
代码:
gdrive upload -p 4ij0ox5ArP61myYUZzYW6rR4Jpa0zeGVu /home/wwwroot/a.zip
同步本地目录到网盘指定目录(增量备份,不覆盖远端)
代码:
gdrive sync upload --keep-remote /home/wwwroot/ 4ij0ox5ArP61myYUZzYW6rR4Jpa0zeGVu >> ~/gdrivelogs/sycn2gdrive.log
附编译好的gdrive.zip

TOP

代码:
#!/bin/bash
imagepath="/var/www/ktsee.com/public/i"
imagepathkey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
docpath="/var/www/ktsee.com/public/d"
docpathkey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
surenkidpath=$(cd "$(dirname "$0")";pwd)

# below do not need to change anything

# backup images
$surenkidpath/gdrive-surenkid --config $surenkidpath sync upload --keep-local --delete-extraneous $imagepath $imagepathkey

# backup docs
$surenkidpath/gdrive-surenkid --config $surenkidpath sync upload --keep-local --delete-extraneous $docpath $docpathkey

TOP

发新话题