Crashplan: auto-update .ui_conf on client

Status
Not open for further replies.

Xelas

Explorer
Joined
Sep 10, 2013
Messages
97
Here is my grand contribution to the world. After getting fed up copying/pasting the info from .ui_conf on the server to the client every few days, I wrote a batch file that runs on a Windows client that:
  1. fetches .ui_conf from the server
  2. modifies it so that the "0.0.0.0" gets replaced with the proper IP of the jail
  3. Launches the Crashplan client.
Prerequisites:
  1. You must install Putty along with it's utilities. You need Putty itself and pscp.exe, the SCP client that's part of the bundle.
  2. You must set up SSH on the server, successfully connect, and save the session information within Putty. There is a TON of info on how to do this - please don't ask about that in this thread. You can use key files, key files with password, or just password (not recommended).
  3. You must know how to get to .ui_conf on the server and on the client
Rather than post a shady file, here is the whole thing. Copy/paste it into a file, name it anything you want and stick it anywhere but it must *.bat or *.cmd.

THE CODE IS PRESENTED AS IS. USE AT YOUR OWN RISK. IT MAY EAT YOUR CHILDREN, PETS, BURN DOWN YOUR HOUSE AND CAR, AND ELOPE WITH YOUR SIGNIFICANT OTHER. NO SUPPORT, MORAL, MENTAL, FINANCIAL, PHYSICAL, OR TECHNICAL, IS IMPLIED OR GUARANTEED.
YOU HAVE BEEN WARNED.

Code:
@ECHO OFF
:: This is the name of the Putty session you used and saved to connect to FreeNAS server.
set putty_session=nas

:: IP of the main server that SCP uses. Same IP you used for Putty SSH session above.
set server_ip=192.168.1.30
set server_user=root

:: You may leave this blank ("") - if you do, you will be prompted for the password.
set password=""

:: IP of the Jail itself where Crashplan runs. May be the same as the server_ip if you SSH into the jail directly
set jail_ip=192.168.1.40

:: Path to .ui_info on server (or jail, if you SSH into jail directly)
set server_location="/mnt/MainVol/Jails/Crashplan/var/lib/crashplan/.ui_info"

:: Location of .ui_conf on Windows client PC.
set client_location=c:\ProgramData\Crashplan\ui_info.server

:: BEGIN PROGRAM

if %password% == "" GOTO withoutPW

"C:\Program Files (x86)\PuTTY\pscp.exe" -load %putty_session%  -l %server_user% -pw %password% %server_ip%:%server_location% %client_location%
if errorlevel 1 (
   echo There was an error connecting to the server
   GOTO end )
GOTO continue

:withoutPW
"C:\Program Files (x86)\PuTTY\pscp.exe" -load %putty_session%  -l %server_user% %server_ip%:%server_location% %client_location%
if errorlevel 1 (
   echo There was an error connecting to the server
   GOTO end )

:continue
for /f "tokens=1,2,3 delims=," %%a in (%client_location%) do set port=%%a&set key=%%b&set IP=%%c
echo.Port : %port%
echo.Key  : %key%
set IP=%jail_ip%
echo.IP  : %ip%
echo %port%,%key%,%IP%>.ui_info

ECHO Starting Crashplan client ...
start "" /D "C:\Program Files\CrashPlan\" CrashPlanDesktop.exe
ping 127.0.0.1 -n 4 > nul
:end
 
Last edited:
Status
Not open for further replies.
Top