Full panel backup - in case if there is a server crash
#1
Full panel backup - in case if there is a server crash
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!
Reply
#2
RE: Full panel backup - in case if there is a server crash
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.
[Image: logo2.png]

My being on this forum is all personal and all is done here by me has nothing to with the company Web Improved I work for Smile
Reply
#3
RE: Full panel backup - in case if there is a server crash
(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?
Reply
#4
RE: Full panel backup - in case if there is a server crash
http://forums.sentora.org/showthread.php?tid=242

Also

https://github.com/MBlagui/Sentora-tools...erfiles.sh

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
#5
RE: Full panel backup - in case if there is a server crash
(09-06-2015, 07:41 PM)Me.B Wrote: http://forums.sentora.org/showthread.php?tid=242

Also

https://github.com/MBlagui/Sentora-tools...erfiles.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
Reply
#6
RE: Full panel backup - in case if there is a server crash
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?
Reply
#7
RE: Full panel backup - in case if there is a server crash
(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.
[Image: logo2.png]

My being on this forum is all personal and all is done here by me has nothing to with the company Web Improved I work for Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Improving Security on Your Sentora Panel: Best Practices DylanForeman 0 436 05-27-2025, 06:10 PM
Last Post: DylanForeman
Server Crash rsthomas 3 10 ,451 05-18-2022, 09:26 AM
Last Post: Nigel
Server Vs. Workstation zHostingSolutions 4 11 ,697 09-14-2021, 06:30 AM
Last Post: sparkrack

Forum Jump:


Users browsing this thread: 1 Guest(s)