Ah,
This wonderful invention called the Internet where practically everything is available if you know how to find it.
In this particular case,
If you’re looking for scripts and scriptlets,
One place where people post is a section called “gists” on Github.
Search, and you’ll find several people have posted tar backup scripts that do various things.
And, of course there are likely many other places where there might be posted tutorials, guides, blogs, etc.
Regular backup apps can be good, too.
All depends on personal criteria when choosing a solution.
TSU