Spaces:
Running
Running
| from huggingface_hub import hf_hub_download | |
| import os | |
| import zipfile | |
| HF_TOKEN = os.environ.get('HF_TOKEN') | |
| try: | |
| archivo = hf_hub_download( | |
| repo_id='josejar/n8n', | |
| filename='n8n-backup.zip', | |
| repo_type='dataset', | |
| token=HF_TOKEN | |
| ) | |
| with zipfile.ZipFile(archivo, 'r') as zip_ref: | |
| zip_ref.extractall('/home/node/.n8n') | |
| print("Datos restaurados") | |
| except: | |
| print("No hay backup previo") |