Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
bashスクリプトで同期を行うと、ファイルが完全に書き出されると思いました。サムドライブを見ると、コピーしたすべてのファイルが表示されていましたが、電源障害後、USBドライブには0個のファイルが表示されました。ドライブを手動で取り出す必要がありますか、それともスクリプトでプログラムで実行できることがありますか?
bashスクリプトからusbデバイスを取り出したい場合はumount、デバイス上の単純なものでうまくいくはずです。例えば
umount
mount /dev/usb /mnt/usb # Your copy operations here... then on success: umount /mnt/usb
USBキーがジャーナル化されたファイルシステムを使用している場合は、ディスクへの書き込みを同期するlinuxsync命令を使用することもできます。