Example: Remote host is using port 2222 for sshd.
rsync -avz /path/to/send/ -e “ssh -p 2222” username@hostname:/home/username/to/whatever/path/
Example: Remote host is using port 2222 for sshd.
rsync -avz /path/to/send/ -e “ssh -p 2222” username@hostname:/home/username/to/whatever/path/
Crashplan has an auto-update feature built into it’s software, which is a good thing except that Crashplan on a headless QNAP box will start failing when this happens. Â If the package maintainer would update the QNAP package when this happens this wouldn’t become a problem. Â But I’ve yet to see this ever happen.
Here’s the fix.
You will notice an upgrade directory in your root Crashplan directory, my default directory is /share/MD0_DATA/.qpkg/CrashPlan/upgrade.  If your directory is anything like mine, you will have a bunch of directories with #s on them…these are all the failed automatic upgrades the Crashplan attempted to perform and has failed.  I didn’t even noticed it was failing until my weekly email came out from Code42 and noticed my backups have been failing for about a week due to this.
First stop crashplan on your Qnap,
1 |
sudo /etc/init.d/crashplan stop |
Find the last failed attempt..
1 |
ls -lart |
cd into the last one listed.
1 |
cd 1388728800370.1422425158177/ |
In this directory you will find two jar files, c42_protolib.jar and com.backup42.desktop.jar .
1 |
pwd |
(make note of this directory as we will be needing this in a second..)
Now jump over to the main default CrashPlan lib directory, mine is in
/share/MD0_DATA/.qpkg/CrashPlan/lib/
Need to copy the two jar files listed above into this lib directory, but first make backups of these files..
1 2 3 4 5 |
cd /share/MD0_DATA/.qpkg/CrashPlan/lib/ sudo mv com.backup42.desktop.jar com.backup42.desktop.jar.old sudo mv c42_protolib.jar c42_protolib.jar.old sudo cp /share/MD0_DATA/.qpkg/CrashPlan/upgrade/1388728800370.1422425158177/c42_protolib.jar . sudo cp /share/MD0_DATA/.qpkg/CrashPlan/upgrade/1388728800370.1422425158177/com.backup42.desktop.jar . |
Once these are copied, now restart crashplan.
1 |
sudo /etc/init.d/crashplan start |
Now re-open your Crashplan client that runs over the SSH tunnel and viola.. you should be good to go.. Â It should be scanning for changed files to back up.
Once you have verfied this is working again, then remember to clean up the upgrade directory .. you can remove all those numbered directories.
Overview
CrashPlan is designed with the assumption that the CrashPlan app and the CrashPlan service are running on the same machine. Although running the CrashPlan service on a machine without a graphical environment (i.e. running a headless client) is anunsupported feature, this article provides a process for doing so that some users have found useful.
A headless CrashPlan app means that the CrashPlan service is running on a machine without a graphical environment (headless mode), like a Linux or Solaris server. Running a headless CrashPlan app allows you to remotely administer the CrashPlan service that is running as a backup destination.
CrashPlan is comprised of two components:
Use an SSH tunnel to connect the CrashPlan app on one machine (1.1.1.1) to the CrashPlan service on a computer that is text-only (2.2.2.2).
1 |
#servicePort=4243 |
to this:
1 |
servicePort=4200 |
1 |
ssh -f -L 4200:localhost:4243 yourusername@2.2.2.2 -N |
When you’re done using the CrashPlan app on the text-only computer, switch your CrashPlan app back.
1 |
#servicePort=4200 |
Putty is a free Windows SSH client that you can use to do the port forwarding necessary to control a remote CrashPlan client.
1 |
netstat -na | grep LISTEN | grep 42 |
Output should look like this:
1 2 3 |
username$ netstat -na | grep LISTEN | grep 42 tcp4 0 0 *.4242 *.* LISTEN tcp4 0 0 127.0.0.1.4243 *.* |
We want to use SSH to tunnel a local Windows port (4200) to the remote host’s service port (4243).
1 |
telnet localhost 4200 |
A successful connection displays “Connected to HOST_IP†with a long, encrypted string. It looks something like this:
1 2 3 4 5 6 |
username$ telnet 10.10.42.183 4200 Trying 10.10.42.183... Connected to 10.10.42.183. Escape character is '^]'. 0??A???A8???TÅ£?pm??.R??JM???AZ?1?jB?????Ù¡??É€AIcKeyMessageY??0??0?? *?H?? nz^@~?Y?Wq#@AE????7r???k!.?^\??$?]?[{??!'?!~>]}????b??Ê£?J&H;????"0?`PC@G~??? ???k[??B[??=b#?_?#x)H?j?~Hwv???????]{??%8?kT?c?A? |
Once you have confirmed the connection you should be able to stop the local CrashPlan app. Make sure the servicePort is 4200 in the conf/ui.properties file and restart the CrashPlan app.
You do not have to do anything to run in ‘headless mode’. Headless just means you do not run the CrashPlan app UI. The CrashPlan service is running once you install the CrashPlan app.
Simple method to proxy your web browser using SSH.
ssh -D 22222 user@ssh_server
Then open your web browser settings, find the connection settings (network), change to manual proxy..
1 |
SOCKS Host: Â localhost Port: 22222 |
Remove localhost, 127.0.0.1 from No proxy for: Â (firefox) if you happen to have anything in there. Â Ok all the way out.. and try a site.. Â it should work. Â If this fails, might want to check /etc/ssh/sshd_config to make sure AllowTcpForwarding yes is set.
To confirm it’s working just close your SSH session..and try another site, it should fail.
Once this is confirmed working, then you probably will want to use something like this, as this will background the process.
1 |
ssh -fN -D 22222 user@ssh_server |
To test this out with curl you can try using:
1 |
curl --proxy socks5h://localhost:22222 http://private.ip/index.html |
whatever your home web server IP is.. Â If you are using an older version of curl which mine was, you will need to use this
1 |
curl --socks5-hostname localhost:22222 http://private.ip/index.html |
1 2 |
tar zcf - bigfile.img | mbuffer -s 1K -m 512m | ssh otherhost "tar zxf -" |
This helps stabilize any issues with your disk I/O which is a huge bottleneck when copying large files over the network.
Grab mbuffer..