1

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?

1 Answer 1

1

Run the sync command before unmounting.

1
  • Bless you, good sir. :)
    – user6658
    May 14, 2012 at 21:55

You must log in to answer this question.