Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
1–10 of 19 posts
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#2I'm excited to share my recent project, where I took on the challenge of porting a popular but untested 600+ line Bash script to Python. The outcome is [`rsync-time-machine.py`](https://github.com/basnijholt/rsync-time-machine.py), a Python implementation of the [`rsync-time-backup`](https://github.com/laurent22/rsync-time-backup) script. It provides Time Machine-style backups using rsync and creates incremental backups of files and directories to the destination of your choice.
The tool is designed to work on Linux, macOS, and Windows (via WSL or Cygwin). Its advantage over Time Machine is its flexibility - it can backup from/to any filesystem and works on any platform. You can also backup to a Truecrypt drive without any issues.
Unlike the original Bash script, `rsync-time-machine.py` is fully tested. It has no external dependencies (only requires Python ≥3.7), and it is fully compatible with [`rsync-time-backup`](https://github.com/laurent22/rsync-time-backup). It offers pretty terminal output and is fully typed.
Key features include:
* Each backup is in its own folder named after the current timestamp. * Backup to/from remote destinations over SSH. * Files that haven't changed from one backup to the next are hard-linked to the previous backup, saving space. * Safety check - the backup will only happen if the destination has explicitly been marked as a backup destination. * Resume feature - if a backup has failed or was interrupted, the tool will resume from there on the next backup. * Exclude file - support for pattern-based exclusion via the `--exclude-from` rsync parameter. * Automatically purge old backups based on a configurable expiration strategy. * "latest" symlink that points to the latest successful backup.
To learn more about how to use and install `rsync-time-machine.py`, check out the [GitHub repo](https://github.com/basnijholt/rsync-time-machine.py).
I appreciate any feedback and contributions! Feel free to file an issue on the GitHub repository for any bugs, suggestions, or improvements. Looking forward to hearing your thoughts.
Happy backing up!
Please, do let me know if you have any questions or need any further information.
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#3Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#4Hi Hacker News, I'm excited to share my recent project, where I took on the challenge of porting a popular but untested 600+ line Bash script to Python. The outcome is [`rsync-time-machine.py`]( https://github.com/basnijholt/rsync-time-machine.py ), a Python implementation of the [`rsync-time-backup`]( https://github.com/laurent22/rsync-time-backup ) script. It provides Time Machine-style backups using rsync and crea…
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#5Hi Hacker News, I'm excited to share my recent project, where I took on the challenge of porting a popular but untested 600+ line Bash script to Python. The outcome is [`rsync-time-machine.py`]( https://github.com/basnijholt/rsync-time-machine.py ), a Python implementation of the [`rsync-time-backup`]( https://github.com/laurent22/rsync-time-backup ) script. It provides Time Machine-style backups using rsync and crea…
The description sounds like it does largely the same job as rsnapshot ( https://rsnapshot.org/ ). What does yours do differently from rsnapshot?
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#6Looks good, and havent come across it before!
Despite constantly Googling for backup solutions and replacements for TimeMachine!
Side note: I recently put together a TrueNAS Scale based NAS box for TimeMachine.
It's running 5x 4TB drives, using ZFS RAIDZ1, and it's the best network multi-user TimeMachine destination I've ever used! (short of a large direct connected TB SSD)
It's much more responsive to browse and restore over my LAN than I'd have expected!
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#7This is neat, but it still leverages a lot of shell commands, ie ssh, find, mkdir etc..
Re: Python Port of 600 Line Bash Script: rsync-time-machine.py for Rsync Backups
#8How difficult do you think it would be to implement such a system in pure python? This is neat, but it still leverages a lot of shell commands, ie ssh, find, mkdir etc..