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,380 points
39 views

1 answer to this question.

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,240 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,240 points
189 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,810 points
54 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
• 37,320 points
251 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
345 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,240 points
27 views