Using the notation: cτ instead of t' and ct instead of t, the problem with the equation
$$c\tau=ct\sqrt{1-\frac{r_s}{r}}$$
is that it only applies to objects at rest.
A generalized version of the gravitational time dilation formula that takes motion into account comes from taking the integral of the magnitude of a worldline's tangent vectors parametrized by λ. $$c\tau=\int\bigg|\bigg|\frac{d}{d\lambda}\bigg|\bigg|d\lambda$$
Which upon expanding into our time and radius components gives:
$$c\tau=\int\sqrt{\left(\frac{d(ct)}{d\lambda}\frac{\partial}{\partial(ct)}+\frac{dr}{d\lambda}\frac{\partial}{\partial{r}}\right)\cdot\left(\frac{d(ct)}{d\lambda}\frac{\partial}{\partial(ct)}+\frac{dr}{d\lambda}\frac{\partial}{\partial{r}}\right)}d\lambda$$
Setting λ = ct, we can rewrite the equation so that an observer's radius changes over time: r(t), thereby generalizing the formula to multiple dimensions in Schwarzschild spacetime.
r(t) is just a shorthand for r(ct)
(+,-,-,-) metric signature used
$$c\tau=\int\sqrt{\left(\frac{d(ct)}{d(ct)}\frac{\partial}{\partial(ct)}+\frac{dr(t)}{d(ct)}\frac{\partial}{\partial{r(t)}}\right)\cdot\left(\frac{d(ct)}{d(ct)}\frac{\partial}{\partial(ct)}+\frac{dr(t)}{d(ct)}\frac{\partial}{\partial{r(t)}}\right)}cdt$$
$$=\int\sqrt{\left(\frac{d(ct)}{d(ct)}\right)^2\frac{\partial}{\partial(ct)}\cdot\frac{\partial}{\partial(ct)}+\left(\frac{dr(t)}{d(ct)}\right)^2\frac{\partial}{\partial{r(t)}}\cdot\frac{\partial}{\partial{r(t)}}}cdt$$
$$=\int\sqrt{g_{tt}+\left(\frac{dr}{d(ct)}\right)^2(-g_{rr})}cdt$$
where r(t) is linear in the case of constant velocity and quadratic in the case of acceleration.
For example:
$$r(t)=\frac{1}{2}t$$
where r(t) is measured in AU and t is measured in hours, making the velocity of the observer:
$$\frac{dr}{dt}=\frac{1}{2}\frac{AU}{hr}$$
Plugging this into the equation, we get:
$$c\tau=\int\sqrt{g_{tt}+\frac{1}{4}(-g_{rr})}cdt=\int\sqrt{\left(1-\frac{r_s}{r}\right)-\frac{1}{4}\left(1-\frac{r_s}{r}\right)^{-1}}cdt$$
$$=\int\sqrt{\frac{r-r_s}{r}-\frac{r}{4(r-r_s)}}cdt=\sqrt{\frac{r-r_s}{r}-\frac{r}{4(r-r_s)}}\int{cdt}$$
$$=ct\sqrt{\frac{r-r_s}{r}-\frac{r}{4(r-r_s)}}$$