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 Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
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 order to backup db automatically i want to use cron job. So i set cron job at 00 AM suppose that : my infos db name : db db user : zode db pass : 123 the command i use is following PHP Code: mysqldump -u zode -p123 of -K -c -f --compatible=mysql40 --default-character-set=utf8 db > backup/db_`date +%d%m%y`.sql in good time i am looking into backup directory db is in it or not but there is nothing in it
View Replies!
View Related
Cron Job
I run A Centos 4.xx latest kernel server and Ive got a problem with Cron Job reporting. The Cron Jobs themselves are working fine but I keep getting this message, on the hour, every hour Quote: Originally Posted by Email from the Cron Daemon Not a directory: /etc/cron.hourly The folder etc/cron.hourly DOES EXIST! and I cannot work out what could be causing this? Does anyone hgave any ideas what could be causing it
View Replies!
View Related
CRON Job Timing Out
i have had a problem for some time now, regarding my CRON jobs. I am trying to download a large amount of data from ebay (through their API, totally legal and aboveboard) using php, but my CRONjob times out. I have tried resetting the timeout variable, but then it exceeds the maximum filesize SO, my question: is there any way to have a script run as a CRON job, and wen it is complete, call another script?
View Replies!
View Related
Reboot Cron Job
VPS isn't rebooting by itself when it goes down. Anyone has any program/script that monitors heartbeat of the server? Like when it goes down, the program will automatically reboots the system. I know there's such a script out there but I forgot what it called.
View Replies!
View Related
Cron Job Email In DA
I've got limited knowledge in scripting so I've come to the interweb for help. Google hasn't answered any of my queries so the trusty WHT is next. I'm trying to create a script cron that will email my clients once per month with space and bandwidth useage reminders. I'd prefer not to have to set up crons in each individual account, but rather email all with tokening including |name| |bandwidth| |space| out of the allowed space & bandwidth according to the clients package.
View Replies!
View Related
MySQLDUMP Cron Job
setting up a new cron job. I would like to have MySQLDUMP dump my specified database(s) into a specified folder using date and time stamps in the filename. I've done some searching on this but haven't really came up with a way to do all of this at once, or if I may need to setup a cron job to rename the file after the dump has completed. I may be going about this all wrong to begin with, I'm just looking for a very simple and reliable way to backup my databases. I'm testing this on a Shared Web Host account at this time which does have SSH shell access, but I wasn't sure if this makes a difference.
View Replies!
View Related
Bash Automate The Installation Of YUM, CPanel/WHM And CSF
I am trying to automate the installation of YUM, cPanel/WHM and CSF. I have written a script that works perfectly all the way down to installing CSF... It gives me the following error when moving onto the CSF installation; --05:03:37-- [url] Resolving www.configserver.com... 85.13.195.235 Connecting to www.configserver.com|85.13.195.235|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 433358 (423K) [application/x-tar] Saving to: `csf.tgz' 100%[=======================================>] 433,358 338K/s in 1.3s 05:03:39 (338 KB/s) - `csf.tgz' saved [433358/433358] --05:03:39-- http://%0D/ Resolving 15... failed: Name or service not known. FINISHED --05:03:39-- Downloaded: 1 files, 423K in 1.3s (338 KB/s) tar: : Not found in archive tar: Error exit delayed from previous errors ./cPanelServer.sh: line 9: cd: csf: No such file or directory sh: install.sh: No such file or directory ./cPanelServer.sh: line 13: unexpected EOF while looking for matching `"' ./cPanelServer.sh: line 18: syntax error: unexpected end of file Script Contents; Code: ./yum.sh cd /home wget layer1.cpanel.net/latest sh latest cd / rm -fv csf.tgz wget [url] tar -xzf csf.tgz cd /csf sh install.sh echo -n "TESTING = "1" read word sed "s/$word/TESTING = "0"/g" /etc/file.conf > /etc/file.conf.new mv /etc/file.conf.new /etc/file.conf service csf restart done It's seems the script is having issues extracting "csf.tgz", but I have no clue. TBH, this is my first ever script and I'm surprised any of it works!
View Replies!
View Related
Cron Job Deleted - Is Their A Log?
We are running cpanel on one of our servers. Several cron jobs were deleted from the cron panel of one acct. I have no idea of the paths to re-enter these jobs. Is their a log file on the server that will show cron job history from previous runs so I can recover the proper paths?
View Replies!
View Related
Cron Job And Query String
Is it possible to call a cron job with a query string appended to the file. I have no problem setting up crons in the cron tab..but i'd like the cron to fetch a url that looks something like /home/php/some-file.php?a=1 is this possible directly through the cron job? I guess an alternative is call some php file that uses curl but i was wondering if there 's a direct way.
View Replies!
View Related
Random Cron Job Command
I am running wordpress with wp O matic. I want to update my content after 24 hours (but different time each day). Bottom line is I want a cron command which randomly execute after 24 hours instead of a particular time. For example currently wp o matic shows the following command the following command, would you please advice how i change the this command to achieve the above results (right now wordpress is running on my computer so following thing is just for example) */20 * * * * F:Testlogwp-contentpluginswp-o-matic/cron.php?code=8b935355
View Replies!
View Related
Cron Job Not Working Properly
I have a slight problem with a cron job I have setup. I wanted to save a copy of iptables every hour to a folder, so I created a script... here it is: Code: varDate=`date +%y%m%d` varTime=`date +%H%M` filename="IPtablesBackup-$varDate-$varTime" iptables-save -c > /etc/IPtablesBackup/$filename and called is Backup-Script.sh Now if I just execute the script will in root ./Backup-Script.sh I get a new file with the correct filename and iptables info is saved ! Great ! So then I thought, how can I setup this automatically every hour. Which leads me on to my problem. I inputted "crontab -e" added this line Code: 59 * * * * /etc/IPtablesBackup/Backup-Script.sh The problem is the script is run, I know because it creates a new file with the correct time and date, however the file is empty? I have set Backup-Script.sh to 777 and owner and group are both root?
View Replies!
View Related
Cron Job With Multiple Databases
I have several DBs and need to run a cron job on one of the databases every night. to run a repair/optimize on the DB as its very active, this is the command I thought I would use: Code: REPAIR TABLE `etc` , `etc` , Code: OPTIMIZE TABLE `etc` , `etc` , How do I specify which database to run this on in the cron in CPanel?
View Replies!
View Related
Cron Job Failure Mails
I have a server like this: WHM 10.8.0 cPanel 10.9.0-S9966 CentOS 3.8 i686 - WHM X v3.1.0 My cron files are like this: var/spool/cron/ Quote: 33 4 * * * /scripts/upcp 0 1 * * * /scripts/cpbackup */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 2,58 * * * * /usr/local/bandmin/bandmin 24 5 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify 0 0 * * * /usr/local/bandmin/ipaddrmap 0 */1 * * * /usr/local/nobody_check/nobody_check >/dev/null 2>&1 0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1 */5 * * * * perl /root/rvadmin/rvmultiupdate.pl >/dev/null 2>&1 14 6 * * * perl /root/rvadmin/auto_rvskin.pl */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1 But e-mails like tha is coming to me Quote: Cron <root@mavi> /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1 /bin/sh: line 1: 1 : ambiguous redirect Quote: Cron <root@mavi> perl /root/rvadmin/rvmultiupdate.pl >/dev/null 2>&1 /bin/sh: line 1: 1 : ambiguous redirect
View Replies!
View Related
Cron Job Not Working, Restart Services
I'm having a bit of trouble with one cron job that doesn't seem to work. I have others scripts that run hourly fine. However this one does not. The script: restart_monitoring.sh Code: #!/bin/bash service iptables stop service iptables start /root/bandwidth_rules.sh /root/portforward_config.sh exit The two scripts at the end just load a lot of iptables rules back in. The cron job should run hourly (59th minute) The cron job entry Code: 59 * * * * /root/restart_monitoring.sh I have restart crond to enable the new job, still doesn't run. The job is to restart iptables, thus flushing all rules that I have running, then reloading them. I have figured out the problem to be with the "service iptables stop/start" command, it doesn't seem to like doing this...?
View Replies!
View Related
Cron Job :: Run Script Every Second, Of Every Minute, Of Every Day
Say I have a script... /home/user/public_html/script.php I want to run this script every second, of every minute, of every day. How would I do this? I want to set up a cron and run it, I have written a cron and I am running it in shell as I type, but if I close shell the cron exits, can anybody assist me with making a cron run this script every second permanently.
View Replies!
View Related
Scheduled Consecutive Shell Commands Or As Cron Job
Is it possible to schedule consecutive shell commands to be run at a given time or every certain period (like every hour)? This is important for me as I want to schedule to run certain program and then input the following commands afterwards to do and complete the task, all automatically within the specified schedule. One example would be connecting to an FTP. First you'd need to input the ftp command to run the ftp program, then following that, input another commands consecutively within that session (the ftp program) to do and complete the task. I'm running KDE on CentOs4 btw. Is it even possible to do this on cron jobs?
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
Create A Cron Job To Clear Your /tmp Folder Automatically?
how I can create a cron job that runs every 10minutes or so to clear my /tmp folder on one of my servers? Reason I ask is, it keeps getting filled up and doesn't delete the fiels in it and stops certain scripts from running. Also, again, I need step by step instructions, such as: 1) what, where the file is I need to place the cron job in 2) what line of code would I put in that file (what does the cron job line look like for every 10min every day) 3) do I need to restart anything, and if so, what command do I run in shell?
View Replies!
View Related
HOWTO Cron Job To Copy Files From Folder To Root
how to setup a cron job to copy files & directories from one folder to the root folder. I have CPanel X. My root directory is public_html/ I have another directory public_html/uploads containing both files and directories. I need a cron job that will copy all the files & directories from public_html/uploads to the root public_html/ If it helps, here is some system info General server information: Operating system Linux Service Status Click to View Kernel version 2.6.22_hg_grsec_pax Apache version 1.3.39 (Unix) PERL version 5.8.8 Path to PERL /usr/bin/perl Path to sendmail /usr/sbin/sendmail PHP version 4.4.4 MySQL version 4.1.22-standard cPanel Build 11.17.0-STABLE 19434 Theme cPanel X v2.6.0
View Replies!
View Related
Cron Job - "No Input File Specified."
I'm on paid hosting and accessing the cron jobs through a control panel. I have a php script that I'd like to run daily. I've put this script in the folder http://mysite.com/Cron/ . When I navigate to this file directly in my web-browser it runs perfectly and sends me an e-mail. When I try to set up a cron tab to execute it, though I get the following error in the cron output... Quote: Status: 404 X-Powered-By: PHP/4.4.6 Content-type: text/html No input file specified. The command I entered into the control panel was... Quote: php [url] I also tried... Quote: php -q [url] ...and... Quote: php /Cron/SendMail.php ...those times getting the error... Quote: /bin/sh: [url]: No such file or directory why this might not be working for me?
View Replies!
View Related
Cpanel Backups
I would like to know what is the difference in cpanel between a full backup and a daily or weekly backup, and how they work together. I was under the impression that a daily backup was a backup of all the files at the end of the day but apparently according to my host this is not so, and Im a bit confused as to what is the purpose of the daily and weekly backup.
View Replies!
View Related
CPanel Remote Backups
We all know about backups, and compressing files, etc etc... so, what do you guys do in this situation? I have a quad core, 4gb ram, 250gb disk, when I run cpanel backups to my remote server, the server loads go up to 3. Is there any way I can control this and lets say... dont let it go bellow 2? Improved Backup Performance — Speed is safe. cPanel’s backup facilities in 11.24 have seen significant speed increases. In previous versions, load averages while backups were running could be as high as 3. With our reworked and enhanced backup system, load averages tend to stay around 1.2 when backups run on servers with many accounts. This is an extremely substantial performance increase that you and your customers will notice right away. With our new backup system, there is no reason not to keep your data safe."
View Replies!
View Related
Corrupted MySQL Backups CPanel
Just a warning to all other hosts out there using cPanel it currently generates corrupted mysql backups due to a bug in their pkgacct script which has been like this for over 6 days now. [url] So for anyone out there it's an easy fix. Of course not every host is doing it so the fun of helping a customer migrate data and explain to them that their hosts backups being made are all corrupted is lots of fun. Sort of sad but I've been told this isn't a critical enough issue to even push it out to all versions. Right now it makes a great lock in so customers cannot switch providers without a lot more work.
View Replies!
View Related
Restoring Incremental CPanel Backups To A New Drive
We have incremental backups running in our server. We want to move the cPanel accounts to a new cPanel server and restore in that server. The Backup Restore option in WHM will recognize only compressed backups (like .tar.gz) when it is placed in the /home directory. So how do I do about restoring a incremental backup through the WHM of the new server?
View Replies!
View Related
Restoring Full Backups - CPanel And PuTTy
I’ve just switched to a deticated server. I have backups of sites I need to move over and restore. cPanel has a “Restore a Full Backup/cpmove” option. Two questions… 1) How do I upload the back up file to the /home directory of my deticated server? 2) If the backup file is under a current client “/home/clienta” how do I restore it? I’ve also tried using puTTy to restore the file. - logged into as “root” - typed “cd /home” - typed “/scripts/restorepkg domainname”
View Replies!
View Related
Can I Transfer A Site From CPanel Backups To Dedicated With No Control Panel
I am planning on moving to a dedicated server from my current shared host. In my cpanel i have the options: Generate/Download a Full Backup Download a home directory Backup Download a MySQL DB Backup Download Alias/Filter Backup I suppose a "Full Backup" would be ideal. But are these backup files only restorable by cpanel, or can I use them to successfully migrate my entire site to the dedicated server? It's running Debian with no control panel. I could install a free one if necessary.
View Replies!
View Related
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 Replies!
View Related
|