Copy log files to local machines using Jenkins

0 votes

I want to copy log files to local machines using jenkins. Is there any script for it.? I tried one but it isn't working.

#!/bin/sh

USER=< ssh user>
HOST=< remote host>
LOG_DIR=< log file location>
FILE=< log file>
cmd="ssh $USER@$HOST cat $LOG_DIR/$FILE"

echo $cmd
$cmd
May 2, 2018 in Other DevOps Questions by DragonLord999
• 8,360 points
34 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Try initializing the variables with values according to you particular situation like set HOST,USER,etc to their respective correct values.
 

#!/bin/sh
USER=login_of_user_on_remote_system_that_can_access_logs
HOST=host.name.of.remote.host
LOG_DIR=/absolute/path/to/where/the/log/file/is/
FILE=name_of.log
DESTINATION_DIR=/where/to/save/log/on/local/host/

scp $USER@$HOST:$LOG_DIR/$FILE" $DESTINATION_DIR
answered May 2, 2018 by ajs3033
• 7,040 points

Related Questions In Other DevOps Questions

0 votes
1 answer

How to get the most recent ebs snapshot using terraform datasource?

It's not available in the latest release ...READ MORE

answered Jul 8, 2018 in Other DevOps Questions by Atul
• 10,200 points
151 views
0 votes
1 answer
0 votes
1 answer

Using conditional to execute a command in salt

You can use unless inside your state ...READ MORE

answered Jul 23, 2018 in Other DevOps Questions by DareDev
• 6,560 points
37 views
+1 vote
1 answer

Import build/release json export files to tfs source control through API

The APIs of "Import build/release definition json ...READ MORE

answered Jul 25, 2018 in Other DevOps Questions by Kalgi
• 35,800 points
213 views
+13 votes
2 answers
0 votes
1 answer
+1 vote
2 answers

Unable to build TFS project because files not found

Please make a folder in solution Nd ...READ MORE

answered May 16 in Other DevOps Questions by Shashikesh Mishra
225 views
0 votes
1 answer

Unable to create BlueMix DevOps services account

Jazzhub is shut now. try https://console.bluemix.net/devops/getting-started. It's ...READ MORE

answered May 28, 2018 in Other DevOps Questions by ajs3033
• 7,040 points
22 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.