I'm writing a script for a usb dumper that detects devices and copy its contents to a location of my choice. I want to make a zip of the original directory but I don't want the scrip to stop detecting new devices while its zipping the file.
I have a while loop that uses a function to read the content of ubuntu's /media/user/* folder and I use gcp to copy the contents of the new Devices.
What command can I place so that the script doesn't stop the detection of devices just to zip the file?
Thanks for the help
You can run anything in a subshell in the background with the
&
operator, such asThat way, the zip process will run in the background while your loop continues.