├── .github └── README.md ├── CNAME ├── LICENSE ├── bscp └── index.html /.github/README.md: -------------------------------------------------------------------------------- 1 | # Bscp – Secure and efficient copying of block devices 2 | 3 | Please find the project website and documentation at 4 | 5 | * https://bscp.njh.eu 6 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | bscp.njh.eu 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and/or distribute this software for any 2 | purpose with or without fee is hereby granted, provided that the above 3 | copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 6 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 7 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 8 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 9 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 10 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 11 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 12 | -------------------------------------------------------------------------------- /bscp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (C) 2012-2023 The Bscp Authors 4 | # 5 | # Permission to use, copy, modify, and/or distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | import hashlib 18 | import struct 19 | import subprocess 20 | import sys 21 | 22 | if sys.version_info < (3, 0): 23 | range = xrange 24 | 25 | remote_script = r''' 26 | import hashlib 27 | import os 28 | import os.path 29 | import struct 30 | import sys 31 | 32 | if sys.version_info < (3, 0): 33 | stdin_buffer = sys.stdin 34 | stdout_buffer = sys.stdout 35 | range = xrange 36 | else: 37 | stdin_buffer = sys.stdin.buffer 38 | stdout_buffer = sys.stdout.buffer 39 | 40 | (size, blocksize, filename_len, hashname_len) = struct.unpack('= 4: 175 | blocksize = int(sys.argv[3]) 176 | else: 177 | blocksize = 64 * 1024 178 | if len(sys.argv) >= 5: 179 | hashname = sys.argv[4] 180 | else: 181 | hashname = 'sha256' 182 | assert len(sys.argv) <= 5 183 | except: 184 | usage = 'bscp SRC HOST:DEST [BLOCKSIZE] [HASH]' 185 | sys.stderr.write('Usage:\n\n %s\n\n' % (usage,)) 186 | sys.exit(1) 187 | (in_total, out_total, size) = bscp(local_filename, remote_host, remote_filename, blocksize, hashname) 188 | speedup = size * 1.0 / (in_total + out_total) 189 | sys.stderr.write('in=%i out=%i size=%i speedup=%.2f\n' % (in_total, out_total, size, speedup)) 190 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Bscp – Secure and efficient copying of block devices 7 | 28 | 29 | 30 |

Bscp – Secure and efficient copying of block devices

31 |

32 | Bscp copies a single file or block device over an SSH 33 | connection, transferring only the parts that have changed. 34 |

35 |

36 | In other words, it handles the edge case where rsync fails. 37 |

38 |

Download

39 |
git clone https://github.com/bscp-tool/bscp
40 |

Usage

41 |
bscp SRC HOST:DEST [BLOCKSIZE] [HASH]
42 |

The default BLOCKSIZE is 65536 (64 KiB).

43 |

The default HASH algorithm is sha256 (SHA-256).

44 |

Comparison

45 |

46 | Bscp is similar to the classic 47 | blocksync.py, 48 | but provides the following advantages: 49 |

50 | 72 |

Contact

73 | 76 |

See also

77 | 85 | 86 | 87 | --------------------------------------------------------------------------------