How to specify the folder on remote machine for backup usinf thinBackup plugin of jenkins? - jenkins

I want to take the backup of jenkins confuguration in case if I lode my machine. I am using the thinBackup plugin provided by jenkins. It has an option where I provide the path to folder where I want to take the backup.
Now the problem is I want to specify the folder on another machine, as it makes sense to have backup on different machine, how do I specifythe path to that folder? Do I have to specify as if
abc#12.34.567.890:path/to/folder?
I am new to jenkins so any help would be appreciated.

Thin backup performs just copies of jenkins configuration files in a specific folder for convenience. Is up to you to store it to scm or other machines, but it can be done with some simple script that upload your backup zip if exists

Related

jenkins backup plugin or better approach to backup jenkins configurations

If I need to backup jenkins configurations, do you have good recommendations? I'm researching and found https://wiki.jenkins.io/display/JENKINS/Backup+Plugin but I want to be able to automate the whole process
The way I like to do it is as a git repo. Init the repo in the JENKINS_HOME directory. Add a .gitignore file to eliminate the workspace directory(s). Optionally, you can ignore the log and/or logs directories. The plugins directory can probably be rebuilt entirely and doesn't need to be backed up, but it might make sense to dump a directory listing of the plugins directory to a file, or better yet, hit this url and dump that content to a file before you commit changes:
http://jenkinsurl/pluginManager/api/json?depth=1&pretty=true.
You can also ignore the caches directory and the war directory.
Setup a cron job, or a job in Jenkins to commit the changes the git repo on a regular basis. Even put a Jenkinsfile in the root of JENKINS_HOME and use that as your pipeline job to backup itself.
You can use Gearman plugin as an alternative, it supports backup as well as failover in the evnt of an outage.

Jenkins: how to backup projects without workspace

I want to take a backup of all my projects, which is in the \jobs folder, but most of it are the workspaces which is also very big.
You can use the thinBackup plugin.
This plugin backup all the xml files of your Jenkins server.
They are a lot of options if you want to backup more stuff:

Jenkins userContent files

We have a Jenkins master-slave model. Each job that is being run on slaves require a certain amount of configuration files. These files must be copied from master to each slave before the build step. So far I have been able to accomplish this with the Config File Provider Plugin. The drawback of this plugin is that it doesn't support folders, I would like to be able to put the configuration files for slave1 in the folder slave1 and so on. Now I have a huge list of files in the dropdown menu when creating a job and asked to provide configuration files.
This plugin comes with something handy: the configuration files can be edited via the web interface.
On the other hand Jenkins provides a userContent folder on the master accessible via http://[jenkins-server]/userContent that resolves my need for folders, but I haven't found a way to edit these files from the provided web interface.
I must mention that the master is a remote machine and I don't want to connect to it everytime I need to modify a file there. Is there any way to edit the files in the userContent folder, or to organize the files uploaded to the Config File Plugin into folders?
Thanks!
If possible put all the configuration into your SCM system and allow Jenkins to fetch them when needed/as they change.
Then your configuration files are managed just like your source code. As a bonus you can add a new node easily and developers can access and use they configuration files to test their build.
Supporting evidence:
Martin Fowler
Andrew Binstock
Darryl Bowler
If you have environment specific config files you can either load all of the individual config files into into your SCM system (this becomes unmanageable if you have a lot). Alternatively you can still store them in your SCM system and then do some combination of scripting with Jenkins parameters to update them on the fly.

Plugin to Copy Files from Desktop to Jobs Workspace in Jenkins

I have a scenario wherein the users who have created some configuration files need to upload the same from the desktop where they access Jenkins onto the Job's workspace to build and execute tests.
So I did try using the Config File Provider plugin as mentioned in https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin. This seems to work fine to copy the configuration file to the Jenkins UI, which can be later synced to the Slave with the given path in the Build environment of the respective job. But the users who wish to upload these files don't have the administrative rights. Hence they are unable to access the Configuration File Management which is under the Manage Jenkins tab. Is there any way that I can move the Configuration File Management under the Jenkins sidebar and allow users to edit the same.
Are there any other plugins that will help me achieve the same? I did also try Copy to Slave plugin but this only copies the files under $JENKINS_HOME/userContent to the job's workspace. We will have to copy the files from the desktop to $JENKINS_HOME/userContent and then use the plugin.
Wouldn't using a parameterized job and have one of the parameters be a File Parameter? See https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

Is it possible to merge changes on server using Jenkins

I am looking for a way to merge full local directory to a remote server using jenkins. It is easy to use some FTP plugin to delete while remote directory and re-upload all the files, but i would like to only upload new/changed files and remove the deleted files.
Is it possible to do that using jenkins? Maybe some other automation tool?
On Unix or Linux you can run 'rsync' with the two directories as parameters -
either on the local or on the remote host.
Just make sure you are not in the middle of some other operation while 'rsync' runs.

Resources