#!/bin/sh date=`date "+%Y-%m-%dT%H:%M:%S"` rsync -aP --link-dest=/target/current '/source/folder' /target/back-$date rm -f /target/Backups/current ln -s back-$date /target/current
This is a little script I got off the internet and modified a bit. This script is run in my crontab every 5 minutes. The point of this script is to get a filehistory/time machine-ish thing.
I get a list of snapshots in my backupfolder every five minutes (i.e everytime the script is run)
This thing works great. There is one downside though: If there are no files changed it still runs and creates a fully hardlinked snapshot. Is it possible in any way to modify it so that is only takes an actual snapshot if there is a file changed?
I know it doesn't take up any space, but it clutters my backup folder quite a bit..