Hello everyone,
I’m curious to know if my code is working as designed? The first hourly.0 performs a full backup then every snapshot after (hourly.1 —> hourly.11 afterwards is hardlinked. Now here is the part I’m confused. During one of the runs, I’ll get a full backup performed again on hourly.1 and hourly.2 which I don’t understand. If the rotate function moves 10->11 9->10 8->9 7->8 etc... Why don’t I have just 1 full copy? On the 12th run, hourly.11 would have rotated out and been deleted according to my code? Thanks in advance.
du -sch * //
hourly.0 10gb
hourly.1 20k
hourly.2. 20k
and
so
on...
—————
rotateSnapshots()
{
if [ -d “$DST/hourly.0” ]; then
rm -fr hourly.11
for i in {11..1}
do
mv "$DST/hourly.$[${i}-1]" "$DST/hourly.${i}" 2> /dev/null
sleep 1
done
fi
}
runIncremental()
{
/opt/local/bin/rsync -a --delete --link-dest="$DST/hourly.1" "$SRC" "$DST/hourly.0"
sleep 1
}
I’m curious to know if my code is working as designed? The first hourly.0 performs a full backup then every snapshot after (hourly.1 —> hourly.11 afterwards is hardlinked. Now here is the part I’m confused. During one of the runs, I’ll get a full backup performed again on hourly.1 and hourly.2 which I don’t understand. If the rotate function moves 10->11 9->10 8->9 7->8 etc... Why don’t I have just 1 full copy? On the 12th run, hourly.11 would have rotated out and been deleted according to my code? Thanks in advance.
du -sch * //
hourly.0 10gb
hourly.1 20k
hourly.2. 20k
and
so
on...
—————
rotateSnapshots()
{
if [ -d “$DST/hourly.0” ]; then
rm -fr hourly.11
for i in {11..1}
do
mv "$DST/hourly.$[${i}-1]" "$DST/hourly.${i}" 2> /dev/null
sleep 1
done
fi
}
runIncremental()
{
/opt/local/bin/rsync -a --delete --link-dest="$DST/hourly.1" "$SRC" "$DST/hourly.0"
sleep 1
}