How Can I Backup CPanel With Cron
I just went through a week of nightmares, because my host lost hard drives and stuff.. lost my data, etc.. what ever..
I want to work out how I can cron cPanel backups. I did a search online for a cPanel backup manager, but I didn't have much luck.
Or, maybe there's some other way to get regular backups?
I don't really need to backup my whole sites. I keep my files locally, but of course I don't have the databases locally -- or the email records.
All I "really" need is the database SQL files, so that I can rebuild my forums if need be, and also the email setup files -- because I have over 50 domains and I have emails set up on all of them.
I want to have them emailed to myself.
There's an option in cPanel too, which allows me to "generate/download a full backup".. well, how do I "restore" the backup? ie: I know how to backup and restore the home directory, databases and email stuff (there's 3 options in cPanel), but there doesn't seem to be anywhere to restore the full backup.
Anyway, can anyone give me advice on how to keep backups of my cPanel accounts? I don't trust hosts anymore. They say they back stuff up, but they never to.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Cpanel Cron Backup To Ftp
Im setting up new windows server, packed with only FTP server (FileZilla) to remote backups. How can i get my cpanel account make backups and upload them to my FTP server as an cron job? Offcourse i have option to backup via cpanel, but this is needed to do manually every time (setting remote ftp ip, account, passwd etc,). Is there a option in cpanel / whm to do full-backup all my accounts in my reseller account? Or do i need to do it per account? Some of my servers is only reseller accounts without root access, only reseller account.
View Replies!
View Related
Backup MySQL Databases By Cron
how to backup MySQL databases by cron and have the backups sent to you by email, or have them uploaded by FTP. It is based on a script I found at another website though I can confirm it is fully working. Change the commented variables in the following file and save it as backup.sh: Code: #!/bin/sh # This script will backup one or more mySQL databases # and then optionally email them and/or FTP them # This script will create a different backup file for each database by day of the week # i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1) # This is a trick so that you never have more than 7 days worth of backups on your FTP server. # as the weeks rotate, the files from the same day of the prev week are overwritten. #/bin/sh /home/user/directory/scriptname.sh > /dev/null ############################################################ #===> site-specific variables - customize for your site # List all of the MySQL databases that you want to backup in here, # each seperated by a space # If not run by root, only one db per script instance databases="mydbname" # Directory where you want the backup files to be placed backupdir=/home/mydomain/backups # MySQL dump command, use the full path name here mysqldumpcmd=/usr/bin/mysqldump # MySQL Username and password userpassword=" --user=myuser --password=mypasswd" # MySQL dump options dumpoptions=" --quick --add-drop-table --add-locks --extended-insert --lock-tables" # Unix Commands gzip=/bin/gzip uuencode=/usr/bin/uuencode mail=/bin/mail # Send Backup? Would you like the backup emailed to you? # Set to "y" if you do sendbackup="n" subject="mySQL Backup" mailto="me@mydomain.com" #===> site-specific variables for FTP ftpbackup="y" ftpserver="myftpserver.com" ftpuser="myftpuser" ftppasswd="myftppasswd" # If you are keeping the backups in a subdir to your FTP root ftpdir="forums" #===> END site-specific variables - customize for your site ############################################################ # Get the Day of the Week (0-6) # This allows to save one backup for each day of the week # Just alter the date command if you want to use a timestamp DOW=`date +%w` # Create our backup directory if not already there mkdir -p ${backupdir} if [ ! -d ${backupdir} ] then echo "Not a directory: ${backupdir}" exit 1 fi # Dump all of our databases echo "Dumping MySQL Databases" for database in $databases do $mysqldumpcmd $userpassword $dumpoptions $database > ${backupdir}/${DOW}-${database}.sql done # Compress all of our backup files echo "Compressing Dump Files" for database in $databases do rm -f ${backupdir}/${DOW}-${database}.sql.gz $gzip ${backupdir}/${DOW}-${database}.sql done # Send the backups via email if [ $sendbackup = "y" ] then for database in $databases do $uuencode ${backupdir}/${DOW}-${database}.sql.gz > ${backupdir}/${database}.sql.gz.uu $mail -s "$subject : $database" $mailto < ${backupdir}/${DOW}-${database}.sql.gz.uu done fi # FTP it to the off-site server echo "FTP file to $ftpserver FTP server" if [ $ftpbackup = "y" ] then for database in $databases do echo "==> ${backupdir}/${DOW}-${database}.sql.gz" ftp -n $ftpserver <<EOF user $ftpuser $ftppasswd bin prompt cd $ftpdir lcd ${backupdir} put ${DOW}-${database}.sql.gz quit EOF done fi # And we're done ls -l ${backupdir} echo "Dump Complete!" exit Upload backup.sh to your server, to any directory you want. A directory which is not web-accessible will stop your login information being seen by just anyone . You should chmod the file to 777: Code: chmod 777 backup.sh If you uploaded this file from a Windows machine you will need to convert the file to Unix format. You should run the following command by SSH in the appropriate directory: Code: dos2unix backup.sh If you don't have dos2unix installed, you can install it using yum if you have that: Code: yum install dos2unix If you don't have yum, get it here. You may want to test the script at this point to make sure it's doing what you want it to. Change to the appropriate directory and run this command: Code: ./backup.sh Once you're happy with it, enter it into the crontab to run daily (or whenever you want). Cron jobs vary a lot depending on the configuration of your system, so check Google for how to do it on your system. The command you will need to run by cron is: Code: /path/to/file/backup.sh
View Replies!
View Related
Cron Job That Deletes Backup Files Older Than 5 Days
This is on a RHEL 4 Box. I want to create a cron job that deletes backup files that are older than 5 days. I have created a shell script (/usr/local/src/runjob.sh) that runs successfully from the SSH command line: Code: #pwd /usr/local/src #./runjob.sh Here is the script: Code: #!/bin/sh # # find /usr/local/apache/sites/*/BACKUPS/ -maxdepth 1 -atime +5 -iname 'test*.txt' -exec rm {} ; Script has 777 permissions and is owned by root. I have the following entry in crontab: Code: 10 12 * * * /bin/sh /usr/local/src/runjob.sh >/dev/null 2>&1 As shown in the cron log, the job does run, but it does not delete the files. And there are files older than 5 days in the directory that meet the find criteria.
View Replies!
View Related
Using CRON To Restore CPanel Backups Daily
A couple weeks ago, I encountered a big server crash on my VPS that caused me a lot of downtime. I'm currently trying to figure out a solution to keep a current "clone" of all of my server accounts on a second server. That way, if I ever encounter another crash, I'll be able to simply change DNS information to have all accounts "live" using the backup server. I appreciate any input, advice, suggestions, criticism, etc. Here's what I have in mind... 1. I currently have all of my websites hosted on Server #1. (We'll call it that for the sake of avoiding confusion.) 2. I have an automatic nightly backup setup via cPanel / WHM that backs up all accounts from Server #1 to Server #2 via FTP. (Server #2 is in a totally different data center, with a different provider.) 3. The nightly backup packages all of the accounts as "cPanel Full Backups." So, they're compressed, and as such, they don't work as "live, functioning websites" on Server #2. The only way to make them "live and functional" on Server #2 would be to use cPanel to "restore" the backups. 4. So, what I'd like to do is setup a CRON job that would automatically "Restore" the backups each morning on Server #2. That way, Server #2 would always have a functional version of all my accounts, that is less than a day old. Then, if Server #1 ever crashed, I'd just have to change DNS information to point to Server #2, and all of the websites would be live again, without having to physically restore all of the backups using cPanel. I don't know a ton about CRON. However, as I understand it, CRON couldn't actually make cPanel restore the backups. However, I'm assuming that when you use cPanel's "Restore" function, it just goes through a series of processes. So, it seems logical to me that, if you knew what those processes were, you could write a CRON job to automate the process every morning. Did that make sense? If so, is it possible? Do you guys have any input, criticism, etc? If it's doable, can you make any suggestions that would help me make this happen? Finally, if you think you have the expertise to make this happen, I'd be interested in chatting with you via Private Message. I'd be willing to pay to have this done.(Note to Moderators: I'm not sure if my last comment is allowed or not ... if not, please feel free to remove it. I'm far more interested in the discussion of this process than trying to solicit help in making it happen.)
View Replies!
View Related
Using CRON To Restore CPanel Backups Daily
I encountered a big server crash on my VPS that caused me a lot of downtime. I'm currently trying to figure out a solution to keep a current "clone" of all of my server accounts on a second server. That way, if I ever encounter another crash, I'll be able to simply change DNS information to have all accounts "live" using the backup server. I appreciate any input, advice, suggestions, criticism, etc. Here's what I have in mind... 1. I currently have all of my websites hosted on Server #1. (We'll call it that for the sake of avoiding confusion.) 2. I have an automatic nightly backup setup via cPanel / WHM that backs up all accounts from Server #1 to Server #2 via FTP. (Server #2 is in a totally different data center, with a different provider.) 3. The nightly backup packages all of the accounts as "cPanel Full Backups." So, they're compressed, and as such, they don't work as "live, functioning websites" on Server #2. The only way to make them "live and functional" on Server #2 would be to use cPanel to "restore" the backups. 4. So, what I'd like to do is setup a CRON job that would automatically "Restore" the backups each morning on Server #2. That way, Server #2 would always have a functional version of all my accounts, that is less than a day old. Then, if Server #1 ever crashed, I'd just have to change DNS information to point to Server #2, and all of the websites would be live again, without having to physically restore all of the backups using cPanel. I don't know a ton about CRON. However, as I understand it, CRON couldn't actually make cPanel restore the backups. However, I'm assuming that when you use cPanel's "Restore" function, it just goes through a series of processes. So, it seems logical to me that, if you knew what those processes were, you could write a CRON job to automate the process every morning. Did that make sense? If so, is it possible? Do you guys have any input, criticism, etc? If it's doable, can you make any suggestions that would help me make this happen? Finally, if you think you have the expertise to make this happen, I'd be interested in chatting with you via Private Message. I'd be willing to pay a reasonable sum for some help with this.
View Replies!
View Related
Cron Job In Cpanel. Want To Automate Backups
I have been doing some research and I would love some help with this. I want to set up a cron to automatically backup my site's files & databases once a month. And I am not sure what how I do it? - Do I need a script on my server and then the cron job runs it? - Is there a better way to do this then cron?
View Replies!
View Related
Cpanel Not Working... Need To Backup
As a background: They had uptime problems, which have since been resolved, however now they seem to have let their cpanel license lapse. Neither I, nor my clients (nor anyone else on the server, according to their forums), can log into CPanel or WHM, getting the error "Cannot read license file." In the beginning they kept saying it would be fixed in 24 hours. 3 weeks later, still waiting. At any rate, our biggest issue right now is that cpanel has not been working since the first week in July. I make weekly full backups, sent via ftp to a remote server, of all my client sites with a cronjob. Since cpanel has been offline, I haven't had a backup since July 1. I'm doing a straight FTP of all the sites' data individually to my hard drive as I'm not sure what else to do to back up their stuff. I guess my question is: If I have to resort to finding a new host (which, if this doesn't get resolved soon, I'll have to), will these straight FTP backups be enough to restore the sites, including mysql data, email accounts, cgi sections, .htaccess/.htpasswd files, etc? What about WHM data for my reseller account? My assumption is that this will be a lot more work, but hoping it's not my only option.
View Replies!
View Related
Remote CPanel Backup
What's the best way to do a remote backup? Right now I have them all being backed up to a 2nd drive on the server. If I do a remote backup, is it just as easy to access the files and do a restore?
View Replies!
View Related
Custom Cpanel Backup
I have a server that has Cpanel doing nightly backups using the built in auto backup tool in WHM. However, I have one account on the server with a 7 GB database. Everytime this database was dumped to the backup it would lock the database from users accessing it for about 30 minutes. So instead, I'm now using a slave/master replication setup to do the database backup incrementally and have excluded this account from being backed up every night. However, I would still like to be able to back up the account itself. Is there a way to setup a unique cron task to backup just this one account and skip the mysql database export? Does cpbackup do anything more than just zipping up the account's folder in the home directory? Or are there other files it needs to keep in order to do a restore?
View Replies!
View Related
Cpanel Backup Configuration
I'm running low on space ever since switching to incremental backup. I don't want to switch back to the full backups because the gzip was killing the server for an hour every night... I have the following setting turned on: Backup SQL Databases : "Per Account and Entire MySQL Directory" Will I get a full backup if I just do "Per Account" or am I missing something if I set it that way? I have some extra space on The Planet's NAS backup at /mnt/backup but not enough for the full backup. If I could split the backup in two that could work as well.
View Replies!
View Related
CPanel Backup Progression
I have a VPS and backup regularly, both to an NAS and Rsync to an alternate facility. I have VPS set to do backups via the WHM-Cpanel to perform daily, weekly and monthly backups automatically. My question is about the progression of Daily, Weekly and Monthly. How or what day or when does the Weekly and Monthly get set?
View Replies!
View Related
Cpanel Weekly Backup
Cpanel weekly and monthly backups are not exactly an state of the art scripts. Daily backups would be just ok, on the low range of quality, but ok. However when talking about the monthly or weekly copies the rsync process raises so much the load on the server that it is just a waste of time and resources. I do not want to sacrify any of both backups. However I would like to know if anybody has found an alternate script to manage cPanel backups and substitute cPanel's build in script. Even better, something that does incremental over the month start and we can have daily for all days of the month, not just last friday or last month.
View Replies!
View Related
Cpanel Backup, To Incremental Or Not
I was wondering if I would be better to use incremental backup in cpanel instead of disabling the incremental feature and having tar.gz backup. Im doing ssh overnigth on an offsite server. Gzip is -rsync tagged when activated, as per this ccron command: Quote: 0 1 * * * export GZIP="--rsyncable" ; /scripts/cpbackup so they should be rsync friendly? Whats your tougth on this?
View Replies!
View Related
Cpanel Backup Alternative
to backup a site from another hosting company who has disabled the cpanel backup button. I emailed them and ask them to enable it , they said it will take up a lot of processor utilization ... even for 1 cpanel account. AND... if I really need the cpanel backup, I have to pay $30 USD per backup! That's really strange. Never mind that, I was thinking any other way I can do this? I dont have SSH , no putty, just FTP, which I am a bit skeptical when it comes to downloading large qty of files. Any php backup script which I can use to trigger the cpanel backup or just do a zip file with the whole home directory
View Replies!
View Related
Backup On Cpanel Server - How And Why
How should I go about the backup of my cpanel server. I have 2x 250gigs drive in raid 1 + 1x 250gigs hd mounted as /backup I also need offsite backup. Im reading, and im a bit confuse how I should approach this backup thing. Here are a few of my questions: 1) Should I use the built in cpanel backup or a different script? 2) With offsite backup, rsync seems to be the way to go? 3) If I have a 250gigs drive as /home, it seems that my /backup drive needs to be way larger to accept daily / weekly / monthly backup? 4) Is offsite also needs daily /weekly / monthly backup?
View Replies!
View Related
Best Backup Solution (Cpanel Server)?
Example: I have 1 server for hosting, 1 server as Dedicated Backup server (Pls don't recommend me outsourced backup server as I already got one) I am looking for a solution which I am able to do daily backup while keeping low server load as well as able to restore it quickly when I need it. It's a cpanel servers. I understand that CPanel own backup method will tar my files (but I have too many accounts) and it also takes a lot of my server CPU resources which slows down my hosting server. I am now using rsync which does incremental backup that really works and I am happy about it but I paid $55 per month for 1 cpanel servers as I oursourced the rsync installation & server management backup. I have few servers and I don't find it cost effective. Anyone here can suggest different kind of method which I have not known yet? Or I would really appreciate if someone do not mind to share installation procedure for rsync with me. I tried to google for it and find them all very shallow information. This is not a try-and-error.
View Replies!
View Related
Backup In CPanel/WHM Without Mysql
The automatic backups you can setup in cpanel/whm bundle the entire user account. Is it possible for it to save everything except the mysql databases? I have an account that has databases over 5GB+ and would like to handle backing those up separately.
View Replies!
View Related
Setting CPanel Backup Limits
I see several larger cPanel hosts imposing backup restrictions. They disallow backups after X GB of disk space are in use. I understand why they do it (controlled resource usage) -- How would one go about setting up these restrictions?
View Replies!
View Related
Remote Cpanel Server Backup
i run cpanel on centos, and i backup all websites and system setting to the 2nd hd by whm's backup feature everyday, i want to ask if any script or method i can backup all the files to another server in a period of time, it may be a week or 3 three days...etc,
View Replies!
View Related
Best Backup Solution For Vps/cpanel
recently we had a corruption of our server caused by an update but we was luckily able to recover users files with some missing unfortunately. I am looking for a backup solution that is off our server that we can add into cpanel/whm for our clients to use and us.
View Replies!
View Related
Install S3 Backup On CPanel VPS
I'm not experienced with linux or web hosting software and I want to find a way to get my cPanel or WHM to send the backups it does to my amazon s3 storage account. Now I know this can be done as I've see lots of places around the web talk about it. I'm not experienced enough to do it so to just get it done and setup I'm willing to pay someone. My VPS is at ServInt.net running on Centos5 with WHM/cPanel.
View Replies!
View Related
How To Disable Cpanel Full Backup
Whenever clients are generating full back up of their sites all at once and like 10x in one hour, its causing a severe spike in load in the servers is there a way to disable the full backup in cPanel? I know mellowhost is able to do this I also saw this when i was searching google -- Quote: Additionally, you could just give server administrators the option of disabling the gzipping of these user generated backups I believe the gzip process is what usually kills the server when dealing with a large site. Just tarring up the account would use more disk space, but would keep processing and load usage down I don't know how to do that though. Also I use the Backup function in WHM to generate weekly backups of all my customers sites and FTPing to a remote server. I still want that function. I only want the generation of full backup in control panel be disabled.
View Replies!
View Related
CPanel Daily Backup: Load
I have my WHM/cPanel installation configured with daily and weekly backups. I checked at what time of the day the server load was at the minimum and configured the cPanel backup cron to run then. The problem now is: Backing up a few hundred accounts results in a high server load. My server configuration: Dual Processor Quad Core Xeon 5335 2.0GHz with 4GB RAM and 2 x 250GB SATA HDD hosted at SoftLayer. The accounts are located on the first HDD and the backup archives are placed on the second HDD. What can I do about this? I'd like to take daily backups of all accounts but not if my server load increases up to 10... That kind of renders the cPanel backup feature useless if it doesn't even work on a powerful server like this one... Would it help if I use an application such as Auto Nice Daemon to give the backup process a lower priority? But then again that won't work on the MySQL dumps? And I think it's not a CPU problem but an I/O wait problem? Other processes have to wait for disk access because the disk-intensive backup process is running?
View Replies!
View Related
CPanel Server Backup Drive
After adding a second drive mounted as /home2 for backups I attempted to use the cPanel "Configure Backup" and I get the following message. Quotas cannot be built! Your cpbackup destination is on a filesystem which has quotas enabled. Please move it to a filesystem which does not have quotas turned on or a separate partition/disk slice mounted at /backup.Backup has been disabled to prevent quota problems... All searches on how to resolve this really reveal no solutions. I did a google search on "disable filesystem quota" among others and could find nothing.
View Replies!
View Related
How To Backup Database (cpanel Server)
I have a crucial database (mysql). My server is running cpanel. It has daily backup but it is not enough as it is running a lot of transaction daily. I would like to run the backup to backup database only every 30 mins using cronjob. How do i do that in crontab. I have root access to the server.
View Replies!
View Related
NFS Mount And Cpanel Backup
We want to implement NFS mount and do backups via NFS mount. We want to know whether there is any risks in doing this. Is it stable? Can we use NFS for backing up cpanel servers ? We want to know whether is there any advantages or disadvantages of using NFS to have cPanel backup. Will it cause the server to crash?
View Replies!
View Related
CPanel Reseller Backup With Sub-accounts
I have a question When I login to cpanel as reseller, I see all accounts from drop down menu. Q1: If I do full backup from reseller's cpanel, will it backup all accounts that I see from drop down menu? Or should I login each account to backup one by one? Q2: If I can backup all by backing up reseller's cpanel, can I restore all accounts by restoring reseller's cpanel from new server?
View Replies!
View Related
Install Cpanel Backup Into Plesk
I'm going from a reseller account that used cPanel to a dedicated server using Plesk. I don't have access to anything on the cPanel server (long story), but the host said they will create a cPanel backup for me. Is it possible to install this into Plesk? I know it's possible to do a migration from a cPanel server to Plesk, which requires root access that I don't have and can't get, so this cPanel backup is the best I've got.
View Replies!
View Related
How To Disable Generating Full Backup On CPanel
Is there a way you can just disable the Generate Full Backup link in the Backup section of CPanel, and not disable the Backup section completely? Meaning, I just want to disable that one function a client has the ability to do, but I don't want to stop them from being able to download their home directory, mysql databases,etc.
View Replies!
View Related
Backup/restore Of Cpanel Work Properly
I use Incremental backup feature of Cpanel but seems it does not work properly. Yesterday when i restored my customer account, it brought back the files and database of 2 months ago. I set it backup everday so why this happen? My server run Centos 4.5 and Cpanel Stable
View Replies!
View Related
Automated CPanel Home Dir Backup - How To
Is there a way to automate the generation and FTP of home directory backups in Cpanel? CPanel lets you create a full account backup and ftp's the result to another server but can only be done manually from what i understand. Is there a way to initiate the process automatically? maybe schedule it for once a week.
View Replies!
View Related
One Time Cpanel Full Compress Backup
I wish to make a ONE-TIME full backup of all my accounts into /backup directory which is mounted to /dev/sdb1 (secondary drive) What is the SSH command to execute this job? There's likely 100+ accounts in my server. I currently already set a daily uncompressed backup inside my WHM. /backup/cpbackup/daily So I do not want to modify them. I just want to run a one-time compress full backup into /backup/july which I have already created as a new directory.
View Replies!
View Related
CPanel Automated Backup Is NOT Backuping One Big Database
i recently find out that I don;t have an database backup for one of my biggest websites. The database I'm talking about has 228 tables (198.6 MB) In the backup file I only get this : -- MySQL dump 10.11 -- -- Host: localhost Database: lxxxxxxa_sXXXl -- ------------------------------------------------------ -- Server version5.0.45-community-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; The other databases I have tried are all ok, but none is this big. Is there any size limit ? I have uploaded an printscreen with the setings of my WHM.
View Replies!
View Related
|