Backup Website to local TrueNas Server?

alleng

Cadet
Joined
Jul 17, 2023
Messages
1
I am trying to backup my website hosted on HostGator to my local TrueNas Server.
I would like to schedule it to backup weekly to a datashare with shapshots.

I am having major trouble pulling the file from the webserver using the truenas.

I started by trying rsync, but I could not get it to connect. I think it has to do with the ssh keys. see below

Then I tired SFTP, but the website cpanel will only generate encrpted ssh keys which truenas will not take in the key setup.
When I store the keys gererated by truenas on the server, I get a error about a encryption mismatch.

Tried WebDev, which Hostgator calls WebDisk. I created a new webdisk user with readonly on hostgator and it seemed to connect, but gives me the following error.
Code:
Error: <3>ERROR : : error listing: couldn't list files: XML syntax error on line 4: invalid character entity &raquo; Failed to lsjson with 2 errors: last error was: error in ListJSON: couldn't list files: XML syntax error on line 4: invalid character entity &raquo;


I can use Ftp, but I dont really want to, because on the security and it seems like it will pull the entire site everytime, and not just waht has changed.

Has anyone done this before, and how?
 
Joined
Jul 17, 2023
Messages
8
Do you have shell access to your HostGator account? Also did you try creating the keys yourself?

If you have shell access to HostGator, then you can use rsync

Code:
ssh-keygen -i ~/.ssh/hostgator # create a local key for hostgator
ssh-copy-id -f ~/.ssh/hostgator user@remote # copy local key to hostgator
ssh user@remote # See if you can log in without password
exit # If you successfully log into hostgator
sudo rsync -rhPa --progress remote:/path/to/files /path/to/local/directory # start a RSYNC session


To generate your own key:
Log into the shell of TrueNAS,

Code:
ssh-keygen -i ~/.ssh/hostgator
cd ~/.ssh
cat hostgator.pub


Copy that key and put into hostgator's key section. I didn't test it because I don't have a HostGator account, but I do this type of stuff everyday, different systems have different configurations so test by using the -n command on rsync (that is dryrun)


Also, I just noticed you said you don't want to pull the whole site, I would do a full rsync then add the --update argument afterwards
 
Last edited:
Top