I have a linux (Fedora) program that detects the insertion of a USB stick and does an automatic backup via a call to
system("rsync...
Once the system call returns I prompt the user to remove the USB stick. The problem is that the system call returns before rsync has finished copying all of the files to the USB stick. Once the files are big enough the user could easily pull the stick out before the files are all copied.
Short of writing my own cpdir command does anyone know if there is a way around this? I don't see any options on either the system() call or rsync (or cp for that matter) that force a "wait until copy completed" state.
Thanks in advance.
Dave