Command_line sensor to count files in network drive backup directory

I am trying to create a command line sensor that will give me the count of backup files in my networked backup directory. Similar to what the google drive backup does.

Using the new network storage integration I have successfully mounted a NAS drive such that all backups are saved to that drive. It works fine and backups are saved on the NAS.

I assumed that this network drive was “mounted” on my home assistant and I could “simply” do a command_line sensor to get the number of files

System->Storage->Network Storage points to hassOffBackups\hassBackups

My command line (as a package file)

command_line:
  - sensor:
      name: Count backup tar files
      command: "ls -l hassOffBackups/hassBackups/*.tar | wc -l"

But this doesn’t work. I only get zero count.

Any ideas. Thanks

Do you have this hassOffBackups folder in you config directory?
Important notes about the environment and where commands are executed:

No there is no hassOffBackups folder in my config directory. Backups are being created on the NAS. Do I have to manually create this folder?