I referred the following link, the solution works.
https://unix.stackexchange.com/questions/11238/how-to-get-over-device-or-resource-busy
The above solution works when you are manually deleting the file. But I have a python script that deletes the files (automated process). Sometimes I get "Device or resource busy error" when the script tries to delete the files. Consequently, my script fails. I don't know how to resolve this issue using my python script.
**EDIT:**
The script downloads the logs files from a log server. These files are then processed by my script. After the processing is done, the script deletes these log files. I don't think that there is anything wrong with the design.
Exact Error:
OSError: [Errno 16] Device or resource busy: '/home/johndoe/qwerty/.nfs000000000471494300000944'
Asked by Touchstone
(211 rep)
Mar 1, 2017, 05:10 AM
Last activity: Jul 7, 2023, 06:50 AM
Last activity: Jul 7, 2023, 06:50 AM