將圖片從 ubuntu 資料夾複製到 google Drive 資料夾

將圖片從 ubuntu 資料夾複製到 google Drive 資料夾

我正在嘗試制定一個 crontab 計劃,將所有圖片檔案 - steam 螢幕截圖 - 複製到我的Google驅動器帳戶,然後將它們備份到我的家庭伺服器。

到目前為止,我有“cp - R /home/(user)/Pictures/Screenshots/Steam/ gio google-drive://(user)@gmail.com/Screenshots/Steam/”,但這輸出“cp: target '( URL)'不是目錄」。

以前有人這樣做過嗎?我在網上搜尋了一些,但發現很少有最新的和工作的資訊。

答案1

cp - R /home/(user)/Pictures/Screenshots/Steam/ gio google-drive://(user)@gmail.com/Screenshots/Steam/" but this outputs "cp: target '(URL)' is not a directory

您的目錄和選項上有空間,應該如此。

cp -R /home/(user)/Pictures/Screenshots/Steam/gio google-drive://(user)@gmail.com/Screenshots/Steam/

Steam/ gio請注意,我刪除了和上的空格cp - R

如果您的圖片收藏隨著時間的推移而增長,我建議 rsync — 您可以將其設定為僅複製新文件,這樣您就不必覆蓋現有文件。

rsync -ca --ignore-existing /home/(user)/Pictures/Screenshots/Steam/gio google-drive://(user)@gmail.com/Screenshots/Steam/

這只會傳輸目的地(您的Google驅動器)上不存在的新螢幕截圖。

相關內容