Skip to content

Commit 4f67e0b

Browse files
committed
Logging tweaks
Verbose rsync when using `ghe-restore` or `ghe-backup` with `-v`. Print `ghe-hook-env-update` output when using verbose mode only. /cc @dbussink
1 parent ec932a9 commit 4f67e0b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

share/github-backup-utils/ghe-backup-git-hooks-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ rsync_git_hooks_data () {
9494
# Ensure target directory exists, is needed with subdirectories
9595
mkdir -p "$backup_dir/$subpath"
9696

97-
ghe-rsync -a \
97+
ghe-rsync -av \
9898
-e "ssh -q $opts -p $port -F $config_file -l $user" $link_dest \
9999
--rsync-path='sudo -u git rsync' \
100100
"$host:$GHE_REMOTE_DATA_USER_DIR/git-hooks/$subpath/" \

share/github-backup-utils/ghe-restore-git-hooks-cluster

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,26 @@ if [ -d "$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/git-hooks/environments/tarballs" ];
6363
hostname=$(echo $hostnames | awk '{ print $1; }')
6464

6565
if [ -n "$hostname" ]; then
66-
ghe-rsync -aH --delete \
66+
ghe-rsync -avH --delete \
6767
-e "ssh -q $opts -p $port -F $config_file -l $user" \
6868
--rsync-path="sudo -u git rsync" \
6969
"$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/git-hooks/environments/tarballs/" \
70-
"$hostname:$GHE_REMOTE_DATA_USER_DIR/git-hooks/environments/tarballs"
70+
"$hostname:$GHE_REMOTE_DATA_USER_DIR/git-hooks/environments/tarballs" 1>&3
7171

7272
for tarball in $tarballs; do
7373
env_id=$(echo $tarball | cut -d '/' -f 2)
74-
ssh -q $opts -p $port -F $config_file -l $user $hostname "/bin/bash -c 'export PATH=\$PATH:/usr/local/share/enterprise && ghe-hook-env-update $env_id $GHE_REMOTE_DATA_USER_DIR/git-hooks/environments/tarballs/$tarball'"
74+
ssh -q $opts -p $port -F $config_file -l $user $hostname "/bin/bash -c 'export PATH=\$PATH:/usr/local/share/enterprise && ghe-hook-env-update $env_id $GHE_REMOTE_DATA_USER_DIR/git-hooks/environments/tarballs/$tarball'" 1>&3 2>&3
7575
done
7676
fi
7777
fi
7878

7979
if [ -d "$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/git-hooks/repos" ]; then
8080
for hostname in $hostnames; do
81-
ghe-rsync -aH --delete \
81+
ghe-rsync -avH --delete \
8282
-e "ssh -q $opts -p $port -F $config_file -l $user" \
8383
--rsync-path="sudo -u git rsync" \
8484
"$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/git-hooks/repos/" \
85-
"$hostname:$GHE_REMOTE_DATA_USER_DIR/git-hooks/repos" &
85+
"$hostname:$GHE_REMOTE_DATA_USER_DIR/git-hooks/repos" 1>&3 &
8686
done
8787

8888
for pid in $(jobs -p); do

0 commit comments

Comments
 (0)