broctl archive copy vs move

So if we have compresscmd unset then archive-log script does a copy:

archive-log: nice cp $file_name "$dest"

Any reason why it doesn't do move instead ?

I propose changing cp to mv


No.. I don't think there's any good reason. The way it was originally written must have assumed the logs were going to be archived to a different filesystem.

Yes, indeed, pretty sure that was the reason. If we just replaced "cp"
with "mv" that would still be an issue, right? We'd need something a
bit more smart that does the right thing in either case, like Python's
shutil.move does,


I'm not aware of any variety of Linux or BSD where the "mv" command
can't handle moving a file to a different filesystem.

I think the real issue is that with "mv", a copy of the log
would no longer be in the working directory, which is only
an issue if Bro had crashed (that's when post-terminate
runs archive-log with the "-c" option, which indicates that
we shouldn't remove the log after archiving it).