cPanel backup on local HDD

Dante78

Well-Known Member
May 1, 2010
59
0
56
Hello

I have the following situation and I'm asking for your help

Two large HDDs on a shared hosting server and a FTP server who's storing backups. The FTP backup took very long time and I want to know if I can use local HDDs to store backups and then to move via FTP (when backup is complete) to the NAS.

please help

Ionut
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
You could cron move using scp instead, which would be more secure and then simply enable SSH key authentication so that a password isn't prompted.
 

Dante78

Well-Known Member
May 1, 2010
59
0
56
Hello Tristan

So on my question, the answer is YES. I can store locally that backup (create it firs as a incremental backup) and then move it via SCP to NAS. Right?

For SCP transfer do you have any hints?

Cheers
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello Dante78,

Yes, you can do this and I suggest using scp to move the files. I discussed this in another thread:

http://forums.cpanel.net/f49/backup-multiple-destinations-169322.html#post709690

You'll have to setup SSH Keys between the machines so they won't require a password for authenticating, then put a cron into root crontab such as the following:

Code:
0 20 * * * /usr/bin/scp -pr /backup/cpbackup [email protected]:/backup
Here replace IP with the IP for the remote machine that you will be scping the files to for the backup. Replace /backup with the name where you want those files to be copied. This cron would be placed onto the source cPanel server. The time interval would copy the files at 20:00 server time (10pm server time) each day. If you wish it to be a different time, then you could revise the interval. I suggest picking a time at least 10-12 hours later than the backups normally run locally to ensure the backup has completed before it copies the existing files over to the remote machine.

The root crontab is located at /var/spool/cron/root and can be edited either at that location or by issuing "crontab -e" instead. I prefer vi, so I use "vi /var/spool/cron/root" to edit it directly rather than "crontab -e" which on some systems opens it in nano.

Please make a backup of the crontab prior to editing it:

Code:
cp /var/spool/cron/root /root/rootcrontab.bak110713
Thanks!
 

Dante78

Well-Known Member
May 1, 2010
59
0
56
Hello Tristan

Thank you very much for help. really apreciate your effort.

This local backup is more faster then FTP backup scheduled on WHM >> Configure backup?

Also, on Incremental backup it sais that there is no compresion, but 2 lines below there is an option with compresion check box. wich one is the real? :))





Thanks
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Incremental backups will not be compressed. You cannot have both work.

For which is faster, local backups will always be faster, since you are just making the backup rather than making the backup and then copying it to another server.
 

Dante78

Well-Known Member
May 1, 2010
59
0
56
Hello Tristan

Thank a lot for your help. True, it was faster. Now i need to compress these backups. How can i do it? Also if i need an account to restored what's the procedure?

Thanks
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you need to compress the incremental backups, you would have to archive them after they finish being backed up. cPanel cannot provide both incremental backups and compressed backups.

As for an account restore, it would probably be best to open up a new thread, since that's a new question unrelated to making backups. That will make it easier for everyone to follow that separate series of questions.

Thanks!