Restore website in cyberpanel without leaving the desktop

After creating a website backup on cyberpanel

Execute on your desktop

movebk

Now restore website on CyberPanel

Create movebk like this:

sudo nano /usr/local/bin/movebk

#!/bin/sh
echo "Enter exact domain/subdomain name to be moved to /home/backup"
read domain
FILE=/home/$domain/backup/*.tar.gz
echo "Enter user password and enter. Then enter root password and enter"
echo "ENTER to continue"
ssh -p 60022 -t Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo. "su root -c 'mv $FILE /home/backup'"
# credit: https://serverfault.com/questions/1111963/execute-root-commands-through-ssh-user

sudo chmod +x /usr/local/bin/movebk

Obs: change user, domain and port to your script

# credit: https://serverfault.com/questions/1111963/execute-root-commands-through-ssh-user


If your not create regular user and use only root, change script to

echo "Enter exactly domain/subdomain name to be moved to /home/backup"
read domain
FILE=/home/$domain
ssh -p 60022 -t Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo. "su root -c 'mv $FILE/backup/*.tar.gz /home/backup'"

Obs: Dont try this

Comments and suggestions below.