For some reason GoDaddy jailed hosting does not provide rsync, while it allows ssh user sessions to the host. It's not obvious how to move big chunks of data without "resume" functionality. Even worse for backup needs... Here's one of possible solutions based on my own experience. I hope this post could help someone too 🙂
Note that the "$" sign designates commands entered by the local user account, not root.
The "#" sign designates commands entered by root. Can also be done using sudo. Root access is required on the local host only.
- Install the SSHFS package
On Ubuntu it was not there by default. Thus I had to do:
- Setup open keys authentication from your local host to the provider
Note: ssh-keygen needs to be called only once on each host. In case you have the keys already set up - skip that one.
Copy the key to the clipboard
Login to the web-hosting machine:
Paste the key into the file and save the file:
Set the correct attributes of the file:
- Check that the key authentication works
The command should log you on to the hosting machine without requiring a password.
- Create a mount point on local host
- Mount using SSHFS
- Set the group ID as at destination
Sorry, but right now I do not have enough motivation to dig why it's required 🙂
Rsync was throwing errors at me:
rsync: chgrp "/mnt/mysite/DestinationDir/a-schematic-diagram.pdf" failed: Permission denied (13)
I logged to the remote machine and checked the goup id:
Then on a local machine I did:
- Transfer data
In my case I needed to upload tons of PDF files to the hosting machine.
Some suggest using -z option too. Here I doubt we want to zip and unzip the data while transferring it from one local directory to another, even though one of them is mounted on a machine far away 😉
- Unfortunately the connection in my case was dropping quite often.
Thanks to rsync re-connecting does not mean re-sending all data.
Could be wrapped in a script?...
I've seen what could be a better solution to the SSHFS hangs:
I am still testing this...
- Remember to un-mount
Once everything is done:
Please send me a link to your site, where this advise helped 😉
All the hassle described above can be avoided if one uses a smart SFTP client. FileZilla did all the magic for me.