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

Use dd conv=fsync to create backup and dump #147

Merged
merged 1 commit into from
Sep 25, 2014

Conversation

matthewrmshin
Copy link
Member

Ensure that backup and dump data is written to disk before returning a
good status.

Ensure that backup and dump data is written to disk before returning a
good status.
@matthewrmshin
Copy link
Member Author

@benfitzpatrick please review.

echo "svnadmin dump -r$REV --incremental --deltas $REPOS | gzip \\"
echo " | (dd 'conv=fsync' \"of=$TMP_DUMP\" 2>/dev/null)"
svnadmin dump "-r$REV" --incremental --deltas "$REPOS" | gzip \
| (dd 'conv=fsync' "of=$TMP_DUMP" 2>/dev/null) || RET_CODE=$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RET_CODE only gets set if the dd fails:
$PROMPT: false | true || echo oh no
gives nothing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully, any failure in the pipeline will result in a zero sized dump, which will be picked up in the next few lines.

benfitzpatrick added a commit that referenced this pull request Sep 25, 2014
Use `dd conv=fsync` to create backup and dump
@benfitzpatrick benfitzpatrick merged commit 02626fd into metomi:master Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants