Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when destination has no snapshots #31

Closed
silkeh opened this issue Jun 16, 2016 · 1 comment
Closed

Error when destination has no snapshots #31

silkeh opened this issue Jun 16, 2016 · 1 comment

Comments

@silkeh
Copy link

silkeh commented Jun 16, 2016

When running a backup with any amount of snapshots in the source but no snapshots in the destination, the program crashes with the following output:

INFO btrfs-sxbackup v0.6.7
DEBUG ['bash', '-c', 'if [ -f "/source/.btrfs-sxbackup" ]; then exit 10; fi']
DEBUG ['bash', '-c', 'cat "/source/.sxbackup/.btrfs-sxbackup"']
DEBUG ['bash', '-c', 'cat "/destination/.btrfs-sxbackup"']
INFO source :: url [/source/] container [.sxbackup/] retention [3] compress [False]
INFO destination :: url [/destination/] retention [1d:4/d, 1w:2/w, 3m:2/m, 12m:none] compress [False]
INFO preparing environment
DEBUG ['bash', '-c', 'if [ ! -d "/source/.sxbackup/" ]; then btrfs sub create "/source/.sxbackup/"; fi']
DEBUG ['bash', '-c', 'btrfs sub show "/source/.sxbackup/"']
DEBUG ['bash', '-c', 'if [ -d "/source/.sxbackup/.temp"* ]; then btrfs sub del "/source/.sxbackup/.temp"*; fi']
DEBUG ['bash', '-c', 'if [ ! -d "/destination/" ]; then btrfs sub create "/destination/"; fi']
DEBUG ['bash', '-c', 'btrfs sub show "/destination/"']
DEBUG ['bash', '-c', 'if [ -d "/destination/.temp"* ]; then btrfs sub del "/destination/.temp"*; fi']
INFO source :: retrieving snapshots
DEBUG ['bash', '-c', 'btrfs sub list -o "/source/.sxbackup/"']
INFO destination :: retrieving snapshots
DEBUG ['bash', '-c', 'btrfs sub list -o "/destination/"']
ERROR list index out of range
ERROR Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/btrfs_sxbackup/__main__.py", line 216, in main
    job.run()
  File "/usr/local/lib/python3.4/dist-packages/btrfs_sxbackup/core.py", line 971, in run
    and self.source.snapshots[0].name.timestamp != self.destination.snapshots[0].name.timestamp:
IndexError: list index out of range

In case of an empty destination a full snapshot should probably be transferred, in which case the check for a non-matching snapshot should be modified.

@masc3d
Copy link
Owner

masc3d commented Jun 16, 2016

btrfs-sxbackup always tries to preserve the most recent snapshot when cleaning out but yes, it makes sense to support it in case the destination dies. thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants