rsync-time-machine.py π
ππ Advent of Open Source β Day 03/24: A Python port of rsync-time-backup, enhancing Time Machine-style backups.

(See my intro post)
Sometimes the best open source projects start with βI can do better than this.β Thatβs exactly what happened when I looked at laurent22/rsync-time-backup, a popular 600-line Bash script for Time Machine-style backups. While it worked, it had known bugs and was tricky to maintain due to Bashβs limitations. It also lacked tests, type hints (bash duhβ¦), and proper error handling. So, I did what any reasonable developer would do: rewrote it in Python: rsync-time-machine.py
! π
π Origin Story #
I needed reliable backups that worked across platforms and filesystems, unlike Appleβs Time Machine.
While many excellent backup tools exist, I was drawn to the simplicity of this approach: it just creates folders named YYYY-MM-DD-HH-MM-SS
containing your files.
No special tools needed for restoring or browsing - just your regular file explorer!
I created a fully tested, typed, and documented Python port that maintains compatibility with the original while adding modern development practices.
π§ Technical Highlights #
- Creates incremental backups using hard links (saving space while keeping full snapshots)
- Works on Linux, macOS, and Windows (via WSL or Cygwin)
- Supports local and remote (SSH) backups
- Smart backup expiration strategy
- Built-in safety checks and locking mechanism
- Pretty terminal output
- Absolutely zero dependencies beyond Python itself - it just works!
- Usable as a standalone
.py
script or pip installable package - 100% test coverage
π Impact #
The project reached the front page of Y Combinatorβs Hacker News, causing its popularity to explode:
- 381 GitHub stars
- 16 forks
- 6 contributors
- Featured on Real Python podcast
- Active discussion on Redditβs r/commandline
π― Challenges and Solutions #
- Maintaining compatibility with the original Bash script while improving the codebase
- Making it work on Windows through WSL/Cygwin (surprisingly tricky!)
- Handling various edge cases in filesystem operations
- Implementing a robust backup expiration strategy
- Adding comprehensive test coverage for file operations
- Keeping the codebase dependency-free while maintaining functionality
π‘ Lessons Learned #
- Sometimes a rewrite is worth it, especially when adding modern development practices
- Good documentation and test coverage are crucial for backup tools
- The Python community appreciates well-structured ports of useful tools
- Zero dependencies means zero headaches for users
- Cross-platform compatibility (especially Windows) requires careful consideration
- Simple, transparent solutions (like regular folders) can be better than complex ones
Want reliable, cross-platform Time Machine-style backups? Check out the project on GitHub!
#OpenSource #Python #Backups #DevTools #Programming