Sentora Support Forums
Full panel backup - in case if there is a server crash - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Full panel backup - in case if there is a server crash (/showthread.php?tid=1928)



Full panel backup - in case if there is a server crash - mettacell - 09-06-2015

Hello. My Sontora is running on a CentOS 7 VPS. Currently it's serving some accounts.

But considering the risks of a VPS and stability, I was wondering if there is a way I could run a scheduled backup (just like what you get in WHM backup with root) of the whole panel just in case the server fails. Is there a way I could achieve this perhaps linking it with Hubic or MultCloud system?

Even if it cannot restore the full Sentora panel - it's OK. I am mostly worried about the database and user accounts and files. If it can just backup all the user related files (Database and all files in user accounts in separate folders) that would be just great.

Any help will be greatly appreciated  Smile Thank you!


RE: Full panel backup - in case if there is a server crash - bbspike - 09-06-2015

You could use the following commands:

Backup sentora+hosts:

find /var/sentora -path '*.*/.*' -prune -o -type f -print | zip /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.zip -@

Backup all sql:

mysqldump -u root -ps(root password) --events --all-databases| gzip > /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.sql.zip

You can put these commands in a cronjob to run every nicht.


RE: Full panel backup - in case if there is a server crash - mettacell - 09-06-2015

(09-06-2015, 04:56 PM)bbspike Wrote: You could use the following commands:

Backup sentora+hosts:  

find /var/sentora -path '*.*/.*' -prune -o -type f -print | zip /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.zip -@

Backup all sql:

mysqldump -u root -ps(root password) --events --all-databases| gzip > /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.sql.zip

You can put these commands in a cronjob to run every nicht.

Thank you for the reply. But can we schedule an FTP upload too?


RE: Full panel backup - in case if there is a server crash - Me.B - 09-06-2015

http://forums.sentora.org/showthread.php?tid=242

Also

https://github.com/MBlagui/Sentora-tools/blob/master/backupuserfiles.sh

M B


RE: Full panel backup - in case if there is a server crash - mettacell - 09-06-2015

(09-06-2015, 07:41 PM)Me.B Wrote: http://forums.sentora.org/showthread.php?tid=242

Also

https://github.com/MBlagui/Sentora-tools/blob/master/backupuserfiles.sh

M B

Thank you. But I guess that thread is trying to say there is no stable module to achieve that sort of solution. But is there a guide available that can help me cron the job and put it in a .sh script. 

I am a newbie in cron job territory. Would be grateful if anyone could help me a little Smile


RE: Full panel backup - in case if there is a server crash - mettacell - 09-06-2015

I tried to the following but failed... any suggestions?

I've put the script in an .sh file and placed it under directory - /var/sentora/cronbackup/dailybackup.script.sh

Code:
#!/bin/sh USERNAME="****" PASSWORD="*****" SERVER="ftp.****.com" # local directory to pickup *.tar.gz file FILE="/var/sentora/hostdata/" # remote server directory to upload backup BACKUPDIR="/oxenbackup" # login to remote server ftp -n -i $SERVER <<EOF user $USERNAME $PASSWORD cd $BACKUPDIR mput $FILE/*.tar.gz quit EOF #!/bin/sh USERNAME="****" PASSWORD="*****" SERVER="ftp.****.com" # local directory to pickup *.tar.gz file FILE="/var/sentora/hostdata/" # remote server directory to upload backup BACKUPDIR="/oxenbackup" # login to remote server ftp -n -i $SERVER <<EOF user $USERNAME $PASSWORD cd $BACKUPDIR mput $FILE/*.tar.gz quit EOF


In crontab -e added the following: 


Code:
* * * * *  /var/sentora/cronbackup/dailybackup.script.sh
But it's not working.... Any suggestions?


RE: Full panel backup - in case if there is a server crash - bbspike - 09-07-2015

(09-06-2015, 05:06 PM)mettacell Wrote:
(09-06-2015, 04:56 PM)bbspike Wrote: You could use the following commands:

Backup sentora+hosts:  

find /var/sentora -path '*.*/.*' -prune -o -type f -print | zip /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.zip -@

Backup all sql:

mysqldump -u root -ps(root password) --events --all-databases| gzip > /choosedirectory/`date +%a-%d-%b-%H-%M`-backup.sql.zip

You can put these commands in a cronjob to run every nicht.

Thank you for the reply. But can we schedule an FTP upload too?

You can make te directorys for above commands Mount to a NAS or something.