  Stellar high-energy radiation (X-ray and extreme ultraviolet, XUV) drives
atmospheric escape in close-in exoplanets. Given that stellar irradiation
depends on the stellar magnetism and that stars have magnetic cycles, we
investigate how cycles affect the evolution of exoplanetary atmospheric escape.
Firstly, we consider a hypothetical HD209458b-like planet orbiting the Sun. For
that, we implement the observed solar XUV radiation available over one and a
half solar cycles in a 1D hydrodynamic escape model of HD209458b. We find that
atmospheric escape rates show a cyclic variation (from 7.6 to 18.5 $\times$
10$^{10}$ g s$^{-1}$), almost proportional to the incident stellar radiation.
To compare this with observations, we compute spectroscopic transits in two
hydrogen lines. We find non-detectable cyclic variations in Ly$\alpha$
transits. Given the temperature sensitiveness of the H$\alpha$ line, its
equivalent width has an amplitude of 1.9 mA variation over the cycle, which
could be detectable in exoplanets such as HD209458b. We demonstrate that the
XUV flux is linearly proportional to the magnetic flux during the solar cycle.
Secondly, we apply this relation to derive the cyclic evolution of the XUV flux
of HD189733 using the available magnetic flux observations of the star from
Zeeman Doppler Imaging over nearly a decade. The XUV fluxes are then used to
model escape in HD189733b, which shows escape rate varying from 2.8 to 6.5
$\times$ 10$^{10}$ g s$^{-1}$. Like in the HD209458b case, this introduces
variations in Ly$\alpha$ and H$\alpha$ transits, with H$\alpha$ variations more
likely to be observable. Finally, we show that a strong stellar flare would
enhance significantly Ly$\alpha$ and H$\alpha$ transit depths.
