Backup WHM Server to Synology NAS with Rsync

Operating System & Version
centos 7
cPanel & WHM Version
11.98.0

DevTeam9200

Member
Jan 29, 2018
11
2
3
Australia
cPanel Access Level
Root Administrator
Hi All,

I been doing some searching across net and the answers are mixed. I want to use WHM Native backup solution only. I.e. NOT Jet backup and want to backup all accounts to a Synology NAS. I was hoping to use rsync so I could do incremental to minimise bandwidth each night.

I have 2 questions the documentation and forums do not clearly answer:

1. If I use rsync as remote destination backup source to the synology nas will it work? Has any one tested and confirmed this is working ? Or is SFTP the only way to do this to Synlogy?

2. If I am able to use rysnc remote backup destination, can I "remove local backups" from the server default /backup folder and in case of restore , be able to restore directly from the remote desitnation using the native restore in WHM ? I.e. without having to manually first copy the file from remote rsync / sftp destination to the /backup folder first . Can it pull the remote backup file in the restore process directly?

I hope that is clear and do let me know if we are able to assist. Thanks team.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Hey there! I'd be happy to answer these for you.

1 - I don't see a reason why the rsync option wouldn't work. You just need a host/IP, username, password, and directory in order to configure the rsync transport option, so as long as you can connect to your system with an SSH user, I'd expect that to work fine.

2 - No, you'd have to get the file back to the WHM machine before attempting the restore, as outlined here: Remote Restoration | cPanel & WHM Documentation

Let me know if you need more details!
 

DevTeam9200

Member
Jan 29, 2018
11
2
3
Australia
cPanel Access Level
Root Administrator
Hi Thanks for the update. To confirm its not working.

I am getting this issue:

Error: Validation for transport “nas01” failed: Could not create path directory “whm8/”: child exited with code 1

To also add to the above to share some light, I am rsync on port 33322 and its all open and working, also I change to SFTP as destination and all working (i.e. no blocks of firewall, etc etc etc) .

Any assistance to the above would be greatly appreciated? Where could I see more in depth logs of issue would be a good start.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Thanks for the additional details. Just to confirm, are you able to run this command on the server to manually connect?

Code:
ssh [email protected] -p 33322
or this command, if you're testing directly with rsync:

Code:
rsync testfile [email protected]:whm8/testfile -p 33322
If those are working manually but not from the backup transporter, I'd recommend checking the cPanel error log file at /usr/local/cpanel/logs/error_log to see if that provides more details.

Another possible issue is that the remote user doesn't have full shell access, as our implementation of rsync does require shell. More details on that can be found here:

https://support.cpanel.net/hc/en-us...lementations-without-full-shell-capabilities?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
A couple thoughts on that - you may not want to try an entire directory for the test as it would be easier and quicker to just use a single file. I also don't think you need the first slash in "/dantest/" as your "dan" user likely isn't storing files in the root directory - that path is relative to your user's access to the remote system.

I'm picturing something more like this:

Code:
rsync testfile [email protected]:dantest/ -p 222
Do you know if the user has shell access as well on the remote system?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
My CentOS 7 has this version, so it would seem we're using very similar versions:

Code:
# rpm -qa | grep -i rsync
rsync-3.1.2-10.el7.x86_64
Is the remote version of rsync also similar? I really don't have a good answer as to why the rsync command itself would not be connecting.