https://schinagl.priv.at/nt/ln/ln.html
It does exactly what I have been looking for, and possibly more.
So what I wanted to do is this:
- Suppose I have a source folder to backup called c:\source
- Initially I copy everything to a backup location called d:\backup
- Then after things change in c:\source, I want to copy everything to d:\backup2, with these conditions:
- if a file has not been modified, it creates a hard link back to the same file in d:\backup
- if a file has been modified or is new, it copies that file instead
- After some time, I can create a new backup called d:\backup3, but basing off d:\backup2, and so on
Code: Select all
ln --copy c:\source d:\backup
ln --delorean c:\source d:\backup d:\backup2
ln --delorean c:\source d:\backup2 d:\backup3
etc.
I have been doing this by hacking together something using rsync and Linux Subsystem for Windows, but this is far simpler and cleaner using a native Win64 CLI.