Ability to Set Backup Subdirectories in SMB Shares

The addition of mounted network-attached storage in Home Assistant was a very welcome one. I already used @frenck 's addon to automatically back up my server to a SMB share on my network. Since the additon of the built-in feature, I have switched over.

My only issue with the feature is the lack of ability to set the sub-directory. Since the SMB share I use for server backups on HASS is shared with other servers on my network, It’s important for me to be able to organize the share. Home Assistant puts it’s compressed backups directly on the root of the share, while I have directories for all the other machines. Not having to manually copy over the tarballs would be quite the time saver.

Even something as simple as the ability to parse out a path instead of a share name by itself would be very beneficial. Something like this:
image

This is required to make the CIFS feature at all usable for me, so +1.

Thanks for the writeup @djripcord :slight_smile:

By accident (because back to SMB/CIFS didn’t work for me at all initially), I learned that it is indeed possible to specify subdirectories directly in the “Remote share” field with a forward slash

In @djripcord’s example, I am pretty sure
Server_Backups/Sub-dir1/Home_Assistant_Backups
should work.

In this case Server_Backups is the name of the actual SMB share, and Sub-dir1/Home_Assistant_Backups would be the directory tree.

It worked for me (see Backup to network location (SMB/CIFS share) now working - #3 by Palmin)

I think the documentation and the wording in the dialog could be improved, other SMB client implementations have separate fields for Share and Subdirectory, which gets rid of this confusion.

7 Likes

Cool - us are right that works for Backup shares (but also for media / normal shares in HA)

Many Thanks - this gives me the possibility to use the new 2025.2 Backup features!

Are there instructions on how to set this up? Especially the SMB share part?

Here you go Common tasks - Operating System - Home Assistant

Thanks for the thought, but I had to figure it out on my own since that didn’t have a Wiki formatted guide to setting up backups.

What I ended up doing was

  1. Install Samba Server Addon. The Backup folder is shared by default.
  2. Mount the Backup folder on my Macbook.
  3. Configure my Hazel file manager app to move backup files to my Mac’s SSD.

Now I have a copy of the backup file in 3 places -

  • Macbooks SSD
  • Backblaze Cloud Storage
  • Time Machine share on my NAS.

So, I have a high confidence that I can access my backups when I need them.