Rsync does the signal handler solution, which seems to be the best option. If we receive SIGINT, SIGHUP, or SIGTERM, we should remove all temporary files we created. If we only have one temporary file at a time, the solution is relatively easy (a global variable), if we have multiple temporary files, we need to have a global list of items.
Rsync does the signal handler solution, which seems to be the best option. If we receive SIGINT, SIGHUP, or SIGTERM, we should remove all temporary files we created. If we only have one temporary file at a time, the solution is relatively easy (a global variable), if we have multiple temporary files, we need to have a global list of items.