mirror of
				https://github.com/opennetworkinglab/onos.git
				synced 2025-11-04 10:11:16 +01:00 
			
		
		
		
	Allow use of rsync when fetching logs
Change-Id: I561ae3c9ebe7765d76a0835c712d17e86b731df3 (cherry picked from commit 359f4d84608c44541c43bfc564893ac76c326063)
This commit is contained in:
		
							parent
							
								
									cb4327a09e
								
							
						
					
					
						commit
						27e94e4057
					
				@ -38,6 +38,22 @@ fi
 | 
				
			|||||||
# Execute the remote commands
 | 
					# Execute the remote commands
 | 
				
			||||||
for node in $nodes; do
 | 
					for node in $nodes; do
 | 
				
			||||||
    echo "fetching from ${node}..."
 | 
					    echo "fetching from ${node}..."
 | 
				
			||||||
 | 
					    USE_RSYNC=${USE_RSYNC:-'false'}
 | 
				
			||||||
 | 
					    # Check if RSYNC is installed
 | 
				
			||||||
 | 
					    if [ "$USE_RSYNC" = "true" ]; then
 | 
				
			||||||
 | 
					      if ssh $ONOS_USER@${node} $SSH_OPTIONS which rsync >&2 > /dev/null; then
 | 
				
			||||||
 | 
					        echo "Using rsync"
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        echo "Installing rsync"
 | 
				
			||||||
 | 
					        # TODO check remote OS and use proper method to install rsync
 | 
				
			||||||
 | 
					        ssh $ONOS_USER@${node} sudo apt-get install -y rsync || USE_RSYNC='false'
 | 
				
			||||||
 | 
					      fi
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mkdir -p ${node}
 | 
					    mkdir -p ${node}
 | 
				
			||||||
    scp -p $ONOS_USER@[${node}]:$ATOMIX_INSTALL_DIR/log/atomix.log* ./${node}/
 | 
					    if [ "$USE_RSYNC" = "true" ]; then
 | 
				
			||||||
 | 
					        rsync -avhz --progress [$ONOS_USER@${node}]:$ATOMIX_INSTALL_DIR/log/atomix.log* ./${node}/
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        scp -p $ONOS_USER@[${node}]:$ATOMIX_INSTALL_DIR/log/atomix.log* ./${node}/
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
				
			|||||||
@ -38,6 +38,22 @@ fi
 | 
				
			|||||||
# Execute the remote commands
 | 
					# Execute the remote commands
 | 
				
			||||||
for node in $nodes; do
 | 
					for node in $nodes; do
 | 
				
			||||||
    echo "fetching from ${node}..."
 | 
					    echo "fetching from ${node}..."
 | 
				
			||||||
 | 
					    USE_RSYNC=${USE_RSYNC:-'false'}
 | 
				
			||||||
 | 
					    # Check if RSYNC is installed
 | 
				
			||||||
 | 
					    if [ "$USE_RSYNC" = "true" ]; then
 | 
				
			||||||
 | 
					      if ssh $ONOS_USER@${node} $SSH_OPTIONS which rsync >&2 > /dev/null; then
 | 
				
			||||||
 | 
					        echo "Using rsync"
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        echo "Installing rsync"
 | 
				
			||||||
 | 
					        # TODO check remote OS and use proper method to install rsync
 | 
				
			||||||
 | 
					        ssh $ONOS_USER@${node} sudo apt-get install -y rsync || USE_RSYNC='false'
 | 
				
			||||||
 | 
					      fi
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mkdir -p ${node}
 | 
					    mkdir -p ${node}
 | 
				
			||||||
    scp -p $ONOS_USER@[${node}]:$ONOS_INSTALL_DIR/log/karaf.log* ./${node}/
 | 
					    if [ "$USE_RSYNC" = "true" ]; then
 | 
				
			||||||
 | 
					        rsync -avhz --progress [$ONOS_USER@${node}]:$ONOS_INSTALL_DIR/log/karaf.log* ./${node}/
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        scp -p $ONOS_USER@[${node}]:$ONOS_INSTALL_DIR/log/karaf.log* ./${node}/
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user