![Ubuntu フォルダから Google ドライブ フォルダに写真をコピーする](https://rvso.com/image/1072594/Ubuntu%20%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%81%8B%E3%82%89%20Google%20%E3%83%89%E3%83%A9%E3%82%A4%E3%83%96%20%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%81%AB%E5%86%99%E7%9C%9F%E3%82%92%E3%82%B3%E3%83%94%E3%83%BC%E3%81%99%E3%82%8B.png)
すべての画像ファイル(Steam スクリーンショット)を Google ドライブ アカウントにコピーし、ホーム サーバーにバックアップする crontab スケジュールを作成しようとしています。
これまでは「cp - R /home/(user)/Pictures/Screenshots/Steam/ gio google-drive://(user)@gmail.com/Screenshots/Steam/」を実行しましたが、「cp: target '(URL)' is not a directory」という出力が出ます。
これまでにこれをやった人はいますか? Web で少し検索しましたが、最新かつ実用的な情報はほとんど見つかりませんでした。
答え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 ドライブ)に存在しない新しいスクリーンショットのみが転送されます。