creativeprojects / resticprofile

Configuration profiles manager and scheduler for restic backup
https://creativeprojects.github.io/resticprofile/
GNU General Public License v3.0
604 stars 29 forks source link

status.json with zero values after first backup #351

Closed talesam closed 3 months ago

talesam commented 3 months ago

I'm intrigued, I configured everything, apparently correct, the files are correct, backup without errors, but the status always shows zero values, could anyone help me?

root@jellyfin2:/var/lib/restic# resticprofile -n default backup
2024/03/26 13:47:49 using configuration file: /etc/resticprofile/profiles.yaml
2024/03/26 13:47:49 profile 'default': starting 'backup'
repository 7a2bac9b opened (version 2, compression level auto)
no parent snapshot found, will read all files
[0:00]          0 index files loaded

Files:       256932 new,     0 changed,     0 unmodified
Dirs:        103769 new,     0 changed,     0 unmodified
Added to the repository: 17.174 GiB (16.049 GiB stored)

processed 256932 files, 17.287 GiB in 11:34
snapshot fa874461 saved
2024/03/26 13:59:27 profile 'default': finished 'backup'
root@jellyfin2:/var/lib/restic# cat status.json | jq '.'
{
  "profiles": {
    "default": {
      "backup": {
        "success": true,
        "time": "2024-03-26T13:59:27.708327005-03:00",
        "error": "",
        "stderr": "",
        "duration": 699,
        "files_new": 0,
        "files_changed": 0,
        "files_unmodified": 0,
        "dirs_new": 0,
        "dirs_changed": 0,
        "dirs_unmodified": 0,
        "files_total": 0,
        "bytes_added": 0,
        "bytes_total": 0
      },
      "check": {
        "success": true,
        "time": "2024-03-25T22:53:05.437015633-03:00",
        "error": "",
        "stderr": "",
        "duration": 8
      }
    }
  }
}
root@jellyfin2:/var/lib/restic# resticprofile snapshots
2024/03/26 14:00:39 using configuration file: /etc/resticprofile/profiles.yaml
2024/03/26 14:00:39 profile 'default': starting 'snapshots'
repository 7a2bac9b opened (version 2, compression level auto)
ID        Time                 Host        Tags        Paths
------------------------------------------------------------------
fa874461  2024-03-26 13:47:49  jellyfin2               /home/jelly
------------------------------------------------------------------
1 snapshots
2024/03/26 14:00:46 profile 'default': finished 'snapshots'
root@jellyfin2:/var/lib/restic# 

My resticprofile:

root@jellyfin2:/var/lib/restic# cat /etc/resticprofile/profiles.yaml 
global:
  # Define o agendador a ser usado como systemd (para sistemas Linux)
  scheduler: systemd
  # Define o comando padrão como "profiles" (para usar os perfis definidos neste arquivo)
  default-command: "profiles"
  # Desativa a saída verbose (detalhada)
  verbose: true
  # Define a prioridade do processo como baixa
  priority: low
  # Define o tempo de espera para tentar adquirir o lock do restic novamente (1 hora)
  restic-lock-retry-after: 1h
  # Define a idade máxima para considerar um lock do restic como obsoleto (4 horas)
  restic-stale-lock-age: 4h
  # Define o caminho para o binário do restic
  restic-binary: "/usr/local/bin/restic"

default:
  # Define o repositório de backup como um bucket no OneDrive criptografado com rclone
  repository: "rclone:onedrive-crypt:/BECAPE/Server-Jelly"
  # Define o arquivo que contém a senha para criptografar os backups
  password-file: "/etc/restic/password.key"
  # Define o arquivo para armazenar o status dos backups
  status-file: "/var/lib/restic/status.json"

  backup:
    # Desativa a saída verbose para backups
    verbose: false
    # Define o diretório a ser incluído no backup
    source:
      - "/home/jelly"
    # Define os diretórios a serem excluídos do backup
    exclude:
      - "/home/jelly/Contos"
      - "/home/jelly/Mirabel"
      - "/home/jelly/OneDrive"
    # Define o agendamento para backups diários às 03:03
    schedule: "03:03"
    # Define a permissão necessária para executar o backup agendado
    schedule-permission: "system"

  forget:
    # Mantém os últimos 90 backups
    keep-last: 90
    # Mantém o último bkp de cada mês
    keep-monthly: 1
    # Mantém o último backup de cada ano, até um máximo de 12 anos.
    keep-yearly: 12
    # Habilita a compactação dos backups antigos
    compact: true
    # Habilita a remoção de backups antigos não necessários
    prune: true
    # Define o agendamento para a tarefa de limpeza no dia 28 às 5:00
    schedule: "*-*-28 5:00"
    # Define o tempo máximo de espera para adquirir o lock antes de executar a limpeza
    schedule-lock-wait: "10h"

  check:
    # Define o agendamento para verificar a integridade dos backups aos domingos às 5:00
    schedule: "Sun 5:00"
root@jellyfin2:/var/lib/restic# 
jkellerer commented 3 months ago

Hi @talesam, at the moment you still require extended-status: true like described here https://creativeprojects.github.io/resticprofile/status/index.html#-extended-status when you run your profile interactively.

A fix for this is in the making but since it involves recreating restic output it isn’t something quick to solve.

talesam commented 3 months ago

It worked here, thank you very much!