Backup snapshots to Azure Blob Storage

Tags: #<Tag:0x00007fc42ce4d700> #<Tag:0x00007fc42ce4d098> #<Tag:0x00007fc42ce4c6e8> #<Tag:0x00007fc42ce4c3c8>

I’ve got a python script that uploads all files (backup snapshot files) to Azure blob storage. I’ve created an automation that takes backup every week.

I’m using Appdaemon for my python script but don’t understand how to trigger it. I want to trigger the script each night.

Found this but not sure if it will work … this runs every 10 minute

self.run_every(self.run_every_c, "now", 10 * 60)

Is there a better way of doing this?

Got it to work, see some code blow

import appdaemon.plugins.hass.hassapi as hass

import datetime

class AzureStorage(hass.Hass):

  def initialize(self):

    time = datetime.time(15, 52, 0)

    self.log("initialize AzureStorage script")

    self.run_daily(self.run_daily_callback, time)

  def run_daily_callback(self, kwargs):

    self.log("starting backup")

If you only want to tun it once a day, use run_daily.

Hi @thunem
Are you willing to share the script?
I’m planning on sending backups to Azrue Blob storage, it would be great to see how you’ve accomplished it.

It doesn’t quite answer your question, but figured I’d share this add-on that I wrote to do exactly this. It’s pretty basic, but it uploads all of your snapshots when the add-on starts, I trigger it once a week via an automation.

1 Like