Hi,
There is the archive_status directory in pg_wal, and if there are
files with suffixes ".ready", you can archive not only the file which
was requested, but quite a few more if there are ".ready" files
available. After that you have to rename ".ready" to ".done". Postgres
will not call archive_command for files which already marked as
".done".
I think most of the good backup tools already doing that. For example,
pgBackRest, wal-e, wal-g (just named the tools I was working with)/
Regards,
--
Alexander Kukushkin