To free up space on C:, I would like to move my Jenkins data files (specifically the \\jobs directory) from the default installation directory
Stumbled upon this question because I was short on HDD on C:/ but had plenty on D:/.
The answer of Jeanne Boyarsky had exactly zero effect on my Jenkins. Although I changed the two variables, Jenkins still used the original workspace and jobs directories which consumed 1/3 of my C:/ drive.
A colleague pointed me to the dead easy solution of simply using Symbolic Links for the directories.
After shutting down Jenkins, open your CMD on the %JENKINS_HOME% directory and simply create two links for the big directories:
pushd %JENKINS_HOME%
:: save the old directories
ren workspace workspace.old
ren jobs jobs.old
:: now create the links
mklink /D /J workspace D:\jenkins\workspace
mklink /D /J jobs D:\jenkins\jobs
:: copy the original jobs to the new location
xcopy jobs.old\* jobs\ /sy
After this, restart your Jenkins. If everything works fine, you can safely delete the .old directories.