Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'gf/ls', 'gf/tag', 'zz/import-rsnapshot' and 'bl/selfi…
…ndex' * gf/ls: ls-cmd: hide files with a leading dot by default * gf/tag: Refuse branch/tag names that start with a dot tag-cmd: Some fixups * zz/import-rsnapshot: Adds a testcase for import-rsnapshot. Makes import-rsnapshot use save's -f option. Adds -f option to save to use a given indexfile. Makefile: handle shell commands (cmd/*-cmd.sh) Adds documentation for bup-import-rsnapshot Adds import-rsnapshot command. Adds documentation for save's strip option. Adds testcases for --strip and --strip-path. Adds a strip and strip-path option to bup save. * bl/selfindex: Rename receive-objects command to receive-objects-v2. Write idxs directly rather than using git-index-pack. Send SHAs from the client to reduce server load Use chunkyreader() instead of manually reading multiple blocks.
- Loading branch information
Showing
16 changed files
with
455 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% bup-import-rsnapshot(1) Bup %BUP_VERSION% | ||
% Zoran Zaric <zz@zoranzaric.de> | ||
% %BUP_DATE% | ||
|
||
# NAME | ||
|
||
bup-import-rsnapshot - import a rsnapshot archive | ||
|
||
# SYNOPSIS | ||
|
||
bup import-rsnapshot [-n] <path to snapshot_root> [<backuptarget>] | ||
|
||
# SYNOPSIS | ||
|
||
`bup import-rsnapshot` imports a rsnapshot archive. The | ||
timestamps for the backups are preserved and the path to | ||
the rsnapshot archive is stripped from the paths. | ||
|
||
`bup import-rsnapshot` either imports the whole archive | ||
or only imports all backups for a given backuptarget. | ||
|
||
# OPTIONS | ||
|
||
-n,--dry-rung | ||
: don't do anything just print out what would be done | ||
|
||
# EXAMPLE | ||
|
||
$ bup import-rsnapshot /.snapshots | ||
|
||
# BUP | ||
|
||
Part of the `bup`(1) suite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/sh | ||
# bup-import-rsnapshot.sh | ||
|
||
# Does an import of a rsnapshot archive. | ||
|
||
usage() { | ||
echo "Usage: bup import-rsnapshot [-n]" \ | ||
"<path to snapshot_root> [<backuptarget>]" | ||
echo "-n,--dry-rung: don't do anything just print out what would be done" | ||
exit -1 | ||
} | ||
|
||
if [ "$1" = "-n" -o "$1" = "--dry-run" ]; then | ||
bup() | ||
{ | ||
echo bup "$@" >&2 | ||
} | ||
shift 1 | ||
elif [ -n "$BUP_MAIN_EXE" ]; then | ||
bup() | ||
{ | ||
"$BUP_MAIN_EXE" "$@" | ||
} | ||
else | ||
bup() | ||
{ | ||
bup "$@" | ||
} | ||
fi | ||
|
||
[ "$#" -eq 1 ] || [ "$#" -eq 2 ] || usage | ||
|
||
if [ ! -e "$1/." ]; then | ||
echo "$1 isn't a directory!" | ||
exit -1 | ||
fi | ||
|
||
TARGET= | ||
[ "$#" -eq 2 ] && TARGET="$2" | ||
|
||
|
||
ABSPATH=`readlink -f "$1"` | ||
|
||
for SNAPSHOT in "$ABSPATH/"*; do | ||
if [ -e "$SNAPSHOT/." ]; then | ||
for BRANCH_PATH in "$SNAPSHOT/"*; do | ||
if [ -e "$BRANCH_PATH/." ]; then | ||
# Get the snapshot's ctime | ||
DATE=`stat -c %Z "$BRANCH_PATH"` | ||
BRANCH=`basename "$BRANCH_PATH"` | ||
TMPIDX="/tmp/$BRANCH" | ||
|
||
if [ "$TARGET" == "" ] || [ "$TARGET" == "$BRANCH" ]; then | ||
bup index -ux \ | ||
-f $TMPIDX \ | ||
$BRANCH_PATH/ | ||
bup save \ | ||
--strip \ | ||
--date=$DATE \ | ||
-f $TMPIDX \ | ||
-n $BRANCH \ | ||
$BRANCH_PATH/ | ||
|
||
if [ -e "$TMPIDX" ]; then | ||
rm "$TMPIDX" | ||
fi | ||
fi | ||
fi | ||
done | ||
fi | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.