https://github.com/prasmussen/gdrive
建目錄
gdrive files mkdir cli刪除目錄
gdrive files delete --recursive $Id上傳檔案
gdrive files upload --parent $Id 0-mount.sh for i in `ls`;do gdrive files upload --parent $Id $i ;done列出檔案
gdrive files list列出目錄下面的檔案
gdrive files list --parent $Id分享檔案,預設所有人
gdrive permissions share $Id取消分享
gdrive permissions revoke $Id檔案訊息
gdrive files info $Id Id: $Id Name: $Name Mime: application/vnd.google-apps.document Size: 1 KB Created: 2023-11-01 13:55:52 Modified: 2023-11-01 14:03:21 Shared: False Parents: $Id ViewUrl: https://docs.google.com/document/d/$Id/edit?usp=drivesdk列出共用硬碟
gdrive drives list建立目錄後上傳、開分享後 echo 出連結
#!/bin/bash File= DIR= DirID=`gdrive files mkdir $DIR | awk '{print $6}'` echo "DirID = $DirID" FileID=`gdrive files upload --parent $DirID $File | grep $Id | awk '{print $2}'` echo "FileID = $FileID" gdrive permissions share $FileID ViewUrl=`gdrive files info $FileID | grep ViewUrl | awk '{print $2}' ` echo "Share Url = $ViewUrl"
0 意見:
張貼留言