resuming a large-file backup does not retain already transmitted data
Perhaps I'm doing something wrong, but I'm trying to transfer a large dataset across a WAN connection... Both connections are 100Mbit and using SSH.
The connection inevitably fails for whatever reason. I try to resume to transfer and it deletes all the data.
What am I doing wrong??
borg create --compression lz4 -v --stats --progress [email protected]:repo::T-2016-06-13 /cygdrive/f/VeeamBackup
Using Borg 1.03
your borg commandline looks ok.
why does the connection fail and what error message do you get?
"resuming" works via just doing another backup (it is easiest if you add the time also (not just the date) to your archive name, so you do not get duplicate archive names).
what do you mean by "it deletes all the data"?
finally, please note that borg on cygwin isn't much tested (but could work as long as you backup just normal directories/files without expecting it to handle windows-specific stuff like ACLs or snapshots or accessing locked files).
Hi Thomas,
The connection fails because of a drop on the WAN (I'm assuming)
I think the "resume" functionality may be my mistake. I kept using the same archive name to achieve a full archive. I guess my thought process is backwards, although the resume process isn't documented to my knowledge.
One of the files is 1.2TB.... which is rather difficult to move across a wan. If the BORG backup fails, I can just keep resuming via Date-Time ? Would Borg handle being resumed 20+ times (hypothetically) ?
So if it failed 20 times, the latest finished archive would have all the data intact, correct?
I'm basically making a backup of Veeam backup files (Slightly crazy), but this is just for off-site purposes. I tried using rSync, but if the transfer becomes disconnected at say 1TB, rSync requires the entire file to be re-read and compared block by block.... which definitely takes a long time.
It was my understanding that Borg makes a snapshot every 5 minutes and understands what it has transferred correctly.
Thank you!
FAQ: http://borgbackup.readthedocs.io/en/latest/faq.html#if-a-backup-stops-mid-way-does-the-already-backed-up-data-stay-there
ATM there is no support for checkpointing while processing a file, so you won't get n-minute spaced checkpoints when reading a 1.2 TB file.
Ah that makes sense enkore... So Borg is NOT ideal for transmitting incredibly large files over WAN.
So when I restarted borg backup using the same archive, it deleted all the chunks for the file that was being processed. I interpreted that as deleting the entire archive... but it was just deleting the chunks from the one file that didn't finish processing.
Yes, that's working as intended (rolling back changes with unknown consistency that occured since the last [checkpoint] archive).
Ah that makes sense enkore... So Borg is NOT ideal for transmitting incredibly large files over WAN.
Your best bet would probably be to increase SSHs timeouts even further (assuming it's just the link failing, not a WAN-reconnect which would often assign a different IP address), or try something like mosh ("mobile shell"). mosh may even be compatible with borg. mosh also advertises that it can keep connections alive even when the IPs of the connected peers changes.
You could even try splitting the large file(s) into temporary pieces (like 1000x 1GB) and backup these into a temp backup archive.
Then backup the original big file, that should go rather quickly now.
Afterwards delete the temp backup archive (and the temporary pieces).
AFAIK, this has never been tried before, but could work due to the content defined chunking.
(Maybe first try with a small file and its pieces, like 20x 100MB.)
If you try it and it works, please give feedback here.
well, borg will happyly transfer small increments of massive files, but for the initial backup you might want to use a more reliable connection
I thought this is documented that it only happens in-between files, but at least not in the linked faq answer - should be clarified.
I think that part of the FAQ is also not in the 1.0 docs, so we should probably merge that part back into 1.0-maint as well.
So, to summarize: this ticket can be closed by updating the documentation:
- fix FAQ entry about checkpoints in latest docs in master
- add factlet "checkpoints only happen between files"
- add "split trick" (see above) as a workaround for instable connections and large files
- add a note that the "split trick" won't help you in case you need to restore such a file
- port that change back to 1.0-maint branch docs (so that this FAQ entry is identical in master and 1.0-maint branch)
See #1198 for ideas how to improve this in the code.
Might be also worth mentioning: backing up device-files also disables any checkpoint-functionality.
@dragetd does it? I'ld assume if you backup multiple device files, you'ld also get the between-files checkpoints as with normal big files also.
Yep, true. But I guess dd if=/dev/foo bs=10M | borg… is the more often used way of backing up a disk since that is the example from the docs (I did that a few days ago). --verbose --progress also did not give any output in that case. :)
But I guess that is to be expected.
In that case, you only have 1 file (stdin), so the rule "between files" still holds true (but there is no "between" until the very end of the stream when it commits anyway).