aruhier / virt-backup

Backup your kvm guests managed by libvirt
Other
107 stars 23 forks source link

Restore date specific crash #35

Closed darkobas closed 4 years ago

darkobas commented 4 years ago
markoz@eliteman:~$ virt-backup restore --date 2020/05/09 test centos8 /tmp/restore
Traceback (most recent call last):
  File "/home/markoz/.local/bin/virt-backup", line 8, in <module>
    sys.exit(cli_run())
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 23, in cli_run
    return parse_args_and_run(build_parser())
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 139, in parse_args_and_run
    args.func(parsed_args=args)
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 217, in restore_backup
    backup = group.get_backup_at_date(domain_name, target_date)
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/groups/complete.py", line 205, in get_backup_at_date
    raise BackupNotFoundError
virt_backup.exceptions.BackupNotFoundError: backup not found

markoz@eliteman:/tmp/backups$ tree -hs
.
└── [4.0K]  centos8
    ├── [9.0K]  20200509-192402_2_centos8.json
    ├── [864M]  20200509-192402_2_centos8.tar.gz
    ├── [9.0K]  20200511-110447_2_centos8.json
    ├── [887M]  20200511-110447_2_centos8.tar.gz
    ├── [9.0K]  20200511-132752_3_centos8.json
    └── [887M]  20200511-132752_3_centos8.tar.gz
darkobas commented 4 years ago

restoring last backup works fine though

aruhier commented 4 years ago

Hi, Thanks for this bug report. I have to check, but I think it's because the date has to be in a specific format. Is --date 20200509 working?

Anyway, I need to fix the error output when a backup cannot be found for a specific date.

darkobas commented 4 years ago

no, that doesnt work either, same error

aruhier commented 4 years ago

Can you do a virt-backup ls --domain centos8 test please?

darkobas commented 4 years ago
markoz@eliteman:~$ virt-backup ls --domain centos8
 test
======

centos8: 1 backup(s)
    2020-05-11T18:51:19+00:00: /tmp/backups/centos8/20200511-205119_1_centos8.json
markoz@eliteman:~$ virt-backup restore --date 20200511 test centos8 /tmp/restore
Traceback (most recent call last):
  File "/home/markoz/.local/bin/virt-backup", line 8, in <module>
    sys.exit(cli_run())
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 23, in cli_run
    return parse_args_and_run(build_parser())
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 139, in parse_args_and_run
    args.func(parsed_args=args)
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/__main__.py", line 217, in restore_backup
    backup = group.get_backup_at_date(domain_name, target_date)
  File "/home/markoz/.local/lib/python3.8/site-packages/virt_backup/groups/complete.py", line 205, in get_backup_at_date
    raise BackupNotFoundError
virt_backup.exceptions.BackupNotFoundError: backup not found
aruhier commented 4 years ago

I really need to simplify the process when restoring a backup… Yes, sorry you have to do: virt-backup restore --date 2020-05-11T18:51:19+00:00 test centos8 /tmp/restore.

darkobas commented 4 years ago

got it, thanx for clarification