I use this backup script to keep a macOS-like TimeMachine backup of my Linux boxes. It's never failed me in several years of usage.

laurent22/rsync-time-backup
Time Machine style backup with rsync. Contribute to laurent22/rsync-time-backup development by creating an account on GitHub.