How to take a backup of specific project in jenkins workspaces after successfull / failed build ?

25 views
Skip to first unread message

Poovaraj Thangamariappan

unread,
Dec 24, 2018, 10:52:08 PM12/24/18
to Jenkins Users
Hi,

I want to take a backup of specific project in jenkins workspaces after successfull / failed every build ? Plesae let me know how to take a backup ?

Regards,
Poovaraj

Adam von Nieda

unread,
Dec 25, 2018, 12:42:10 PM12/25/18
to jenkins...@googlegroups.com

   If you want to back up the project XML file, (assuming Linux), you could do a script step like this. You should be able to extend this after you get the idea. 

config_file="$JENKINS_HOME/jobs/$JOB_NAME/config.xml"
cp $config_file $config_file.`date +'%F_%H_%M_%S’`

   Or something like
cp $config_file /some/backup/dir/config.xml.`date +'%F_%H_%M_%S’`


--
Adam vonNieda




--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ac4611ca-b620-4ab4-9fa8-00f610134a77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Poovaraj Thangamariappan

unread,
Dec 26, 2018, 7:21:03 AM12/26/18
to Jenkins User Group
Thanks Adam for clarifying this question.

Regards,
Poovaraj 

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/_OdeTpwKO7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/163208D1-B4FE-4547-A147-68E8B51C2275%40vonnieda.org.

For more options, visit https://groups.google.com/d/optout.


--

Regards,
Poovaraj


Ganesh Kumbhar

unread,
Dec 26, 2018, 11:36:05 PM12/26/18
to Jenkins Users
Hi, 

 I didn't get exact use case as in what do you mean by backup project really and project or few files!!  
 Simply copying those files with your script is also fine, 
but you can go for archiving artifacts option, which you could open from job also!
Reply all
Reply to author
Forward
0 new messages