![將圖片從 ubuntu 資料夾複製到 google Drive 資料夾](https://rvso.com/image/1072594/%E5%B0%87%E5%9C%96%E7%89%87%E5%BE%9E%20ubuntu%20%E8%B3%87%E6%96%99%E5%A4%BE%E8%A4%87%E8%A3%BD%E5%88%B0%20google%20Drive%20%E8%B3%87%E6%96%99%E5%A4%BE.png)
我正在嘗試制定一個 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驅動器)上不存在的新螢幕截圖。