-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from twc-openstack/client-pre-and-post-commands
Add pre/post client side commands
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,2 +1,14 @@ | ||
#!/bin/bash -e | ||
exec <%= @cmd_client_rsync %> --server --sender $* | ||
<% if @preexec.size > 0 -%> | ||
{ # Redirect output to /dev/null so that the reciever isn't confused by | ||
# extraneous output | ||
<%= @preexec.join("\n") %> | ||
} > /dev/null 2>&1 | ||
<% end -%> | ||
<%= @cmd_client_rsync %> --server --sender $* | ||
<% if @postexec.size > 0 -%> | ||
{ # Redirect output to /dev/null so that the reciever isn't confused by | ||
# extraneous output | ||
<%= @postexec.join("\n") %> | ||
} > /dev/null 2>&1 | ||
<% end -%> |
3eab71d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the script defined in preexec will be executed repeatedly if you have multiple backup points.