Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a bash script that will copy files over to drives upon insertion and then unmount. The actual copy line is simple:

cp $SRCDIR/$FILE $DRIVE

and the umount:

umount $DRIVE

However, once cp is done and umount is presented, the filesystem still has to finish the job and I'm presented with this:

dialogue

Now, this script for when I need to copy the same files to around 500 usb drives via a 10 usb hub. I already have my own way to notify me which drive needs to be ejected when, and having a million popup windows is very annoying. Apart from sending a 'sleep 5s' command (which really wouldn't be too bad), is there a way that I can suppress these messages?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Run the sync command before unmounting.

share|improve this answer
    
Bless you, good sir. :) –  user6658 May 14 '12 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.