If the backup location no longer exists or was moved, this will fail. It's also probably not a good idea to automatically backup a restored cluster to the same backup location, especially because a fully restored cluster (i.e. restored from all WAL, not to a particular point in time) doesn't appear to get a new timeline.
The cleanest option: set archive_mode to "off" and clear archive_command.