Help! - Just managed to save my scripts.yaml file with no content

So ermm… Damn.

Just managed to somehow delete the content of my scripts file and save it blank.
I was using Notepad++ and Samba Share.

I stupidly haven’t done a backup for while and will lose a lot of work.

I was wondering that as the front end is still running fine, including still running the scripts that are now missing, they must be in memory, and maybe there’s a way to export/save them or something?

I already had a look for temp notepad++ files. But to no avail?

Can anyone help?

Home Assistant
0.65.0

Have you tried CTRL+Z?

:slight_smile: Yep, I know that one well…

I don’t know.

i search from google and found this for notepad++

Thanks. Actually I didn’t realise it while I was still panicking and assessing the damage, but I hadn’t actually done much new work in the script file. New work was mostly in the config and automations files, which were still fine. I restored my backup script.yaml from a week ago, rewrote two scripts (which were much quicker the second time around), and I’m back to where I was with 2hrs work. Now I’ll setup notepadd++ to do regular autosaves and implement a more robust backup routine. Thanks anyway…

I would look at using something like Syncthing.

I have syncthing running on my docker host pointing to my HA config directory, syncthing running on my desktop, laptop, and NAS. All keeping revisions and it allows me to edit locally on my computer, as it just syncs back to my HA. As a fail safe, I commit my changes to my private git repo on Bitbucket, but since secrets.yaml is not something you really want in your repo, I like having a backup of it in multiple locations.

Thanks. I’ll take a look.