bsh, and commands to backup.

Bidi

Well-Known Member
Oct 3, 2012
119
15
68
Romania, Transilvania
cPanel Access Level
DataCenter Provider
Hy guys, in the last days i had a massive problem with my mysql i had to restore 200 databases from backups witch cpanel software makes them but was a big mass so i start to war on some time of backup to make it on external server.

If someone can help me i what to make a bash file so i can setup in cron to run backup to mysql folder and the accounts backup.

I use scp -r -l 10240 -P 22 mysql [email protected]:/home

But my problems is it propmts to add the password so if i make a bash and use sompting like ./backup is not going to work cuz the password. Is there any ways to add in bash file the password and not to propmpt the password any more ?

I use -l 10240 to limit the speed otherwise all the websites will not work any more because is using all the speed of the server, and i think if i make the same using cpanel backup ftp option will be the same eats all the bandwich.

If somenone got good ideas with the bash command or some new ways is allways welcome and i will be more then happy.
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hello,

You will have to setup SSH access key on your server so that your scripts will not propmts for the backup. Some backup plugin are using SSH key for the external backup.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Have you considered using the native backup functionality available in Web Host Manager? You can choose to backup databases on a per-account basis or to backup the entire MySQL directory.

Thank you.