2 - Automatic Remote Backups

CyberPanel allows you to schedule and send backups to remote locations (Daily/Weekly).


Requirements

For automatic remote backups to work there are two requirements.

  1. You need a vps or dedicated server.

  2. Your remote VPS and or dedicated server must have rsync installed on it.

If you have these two requirements met, you are ready to go. Please make sure you also have root access on the vps.


Add/Delete Destination

We first need to add a remote destination where backups will be sent.

Main > Backup > Add/Delete Destination

Just fill in the login details of your remote server and click Add Destination, you can check connection with remote server by clicking Check Connection.

Once the destination is added, you can schedule either daily or weekly backups to this destination.


Schedule Backup

Main » Backup » Schedule Backup

Backup Destination that you just added above will appear here. You can select the destination from the drop down and set the backup frequency.

On remote server backups will be stored at /home/backup/Day-Mon

Backup logs are stored at /usr/local/lscp/logs/back_log.x.x.x

Hello. I am having a problem with setting up a remote backup SFTP destination. I am using the latest CyberPanel version 2.1 build 2. My backup destinations setup screen looks different than yours. When I Add Destination I get an “Operation Failed” message and no destination is created. Here is what my screen looks like. Can you help? EDIT: BTW, I have done SFTP from the command line with this same user, so the SSH key is already added to known_hosts:

I think I found the problem. It looks like CyberPanel is trying scp instead of sftp. I see this in the log:

command: /usr/bin/scp
args: ['/usr/bin/scp', '-o', 'StrictHostKeyChecking=no', '-P', '22', '/root/.ssh/cyberpanel.pub', 'procryptix-ops_user@172.223.43.114:~/.ssh/authorized_keys']
buffer (last 100 chars): b''
before (last 100 chars): b' \r\nThis service allows sftp connections only.\r\n'

And when I do the command on the command line I get this:

# /usr/bin/scp -o StrictHostKeyChecking=no -P 22 /root/.ssh/cyberpanel.pub user@172.XXX.YYY.ZZZ:~/.ssh/authorized_keys
user@172.XXX.YYY.ZZZ's password:
This service allows sftp connections only.
#

Should I setup SCP at the backup server, or how can I use SFTP as CyberPanel specifies?

Hi,

I have faced the same problem as you. Here is what I did to solve the problem:

OBS: My backup server is a Synology NAS DS118.

  1. Enable homes directory for all users on Synology Control Panel

  2. Enable SFTP and rsync on remote server (Synology DS118)

  3. Add rsync account (username and password) on Synology DS118

  4. Execute the following command at the VPS running CyberPanel:

ssh-keyscan -H -p [PORT] [REMOTE-SERVER-IP] >> ~/.ssh/known_hosts

  1. Add the backup destination on CyberPanel Control Panel as you would normally do, now that should work

PS.: You must enable rsync on remote backup server as stated on docs

Hi, i have 2 server with cyberpanel and i try to restore a backup from cyberpoanel1 to cyberpanel2 but when i put the ip + pass it give the user have not api access disabled so i go and enabled the api for this user but continue to see the same error


I think only admin user can be do that, thats right? how can i do it like a simple user??

1 Like

i also use a Synology and i have the same error :frowning: after i did what you told.

This is the log:

# Host 192.168.1.XX found: line 1
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
Timeout exceeded.

command: /usr/bin/ssh
args: ['/usr/bin/ssh', '-o', 'StrictHostKeyChecking=no', '-p', '22', 'XXXX@192.168.1.XXX', 'mkdir ~/.ssh || rm -f ~/.ssh/temp && rm -f ~/.ssh/authorized_temp && cp ~/.ssh/authorized_keys ~/.ssh/temp || chmod 700 ~/.ssh || chmod g-w ~']
buffer (last 100 chars): b' \r\n'
before (last 100 chars): b' \r\n'
after:
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 42493
child_fd: 5
closed: False
timeout: 3
delimiter:
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'please try again.')
1: re.compile(b'Password:')
2: EOF [TIMEOUT setupSSHKeys]

It’s a bug in the cyberpanel?