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,450 points
1,723 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,300 points

Related Questions In Other DevOps Questions

0 votes
0 answers
0 votes
0 answers
0 votes
0 answers

how to install ADOP a.k.a. Accenture devops platform in local desktop without using server?

I came to know that ADOP a.k.a. ...READ MORE

Mar 26, 2022 in Other DevOps Questions by Kichu
• 19,040 points
469 views
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 9, 2018 in Other DevOps Questions by Atul
• 10,240 points
1,779 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,039 views
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 17, 2019 in Other DevOps Questions by Shashikesh Mishra
4,756 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP