Flawed backup strategy

Okay, so a few months ago, I mounted a samba drive on my Gentoo machine that linked to a Windows file server I had lying there.

Then, I added an rsync task to my backup server – every day, along with other folders, a remote server took backups from the Windows machine through the Gentoo server.

All works fine.

Did you guys find the flaw yet? I didn’t find it until this morning.

Yesterday night, the Windows server went down. Its an old Celeron 400mhz – its way past its prime. Problem is, it went down before the nightly backup routine.

So the samba mount “disappeared”.

And when the rsync took place, all the backup could see was an empty mount drive…

And so, rsync synchronized – and wiped the whole backup. Now the folders are synchronized.

  • sigh *

I need to rethink that particular strategy.

Update 1 Instead of the previous setup, I’ve mapped my Gentoo server to the windows network via Samba – I’m sharing the driver directly from the Gentoo server now – much less hassle.

Update 2 Yanik Proulx was kind enough to send me a simple script that fixes the problem by make a rotation backup of the mount (“soft link”) to a hard link. Thanks, buddy!

Another interesting solution would be to rsync from soft to hard link locally after checking the mount status.

Update 3 Another method would be not to backup the root folder of the mounted drive. This way, the folder to backup would not exist and rsync would simply fail.

1 thought on “Flawed backup strategy

Comments are closed.