We have measured the flux of cosmic muons in the Laboratori Nazionali del Gran Sasso at 3800,m,w.e. to be $(3.432 pm 0.003)cdot 10^{-4},mathrm{{m^{-2}s^{-1}}}$ based on ten years of Borexino data acquired between May 2007 and May 2017. A seasonal modulation with a period of $(366.3 pm 0.6),mathrm{d}$ and a relative amplitude of $(1.36 pm0.04)%$ is observed. The phase is measured to be $(181.7 pm 0.4),mathrm{d}$, corresponding to a maximum at the 1$^mathrm{st}$ of July. Using data inferred from global atmospheric models, we show the muon flux to be positively correlated with the atmospheric temperature and measure the effective temperature coefficient $alpha_mathrm{T} = 0.90 pm 0.02$. The origin of cosmic muons from pion and kaon decays in the atmosphere allows to interpret the effective temperature coefficient as an indirect measurement of the atmospheric kaon-to-pion production ratio $r_{mathrm{K}/pi} = 0.11^{+0.11}_{-0.07}$ for primary energies above $18,mathrm{TeV}$. We find evidence for a long-term modulation of the muon flux with a period of $sim 3000,mathrm{d}$ and a maximum in June 2012 that is not present in the atmospheric temperature data. A possible correlation between this modulation and the solar activity is investigated. The cosmogenic neutron production rate is found to show a seasonal modulation in phase with the cosmic muon flux but with an increased amplitude of $(2.6 pm 0.4)%$.