borfast Posted February 14, 2005 Share Posted February 14, 2005 Here's one I'm sure lots of you will appreciate. I sure did appreciate it, being in the middle of studying for college finals and having to set up a database backup system for a client! You have to edit the bash script to set the database details but don't be scared, the script is very well commented, has pretty good documentation (inside the file) and it's really really easy to configure. It creates daily, weekly and monthly backups, rotating the daily ones at the end of the week. Really good stuff! http://sourceforge.net/projects/automysqlbackup/ Enjoy Quote Link to comment Share on other sites More sharing options...
TCH-RobertM Posted February 14, 2005 Share Posted February 14, 2005 Good Find Raul, Thank you Quote Link to comment Share on other sites More sharing options...
musiclc Posted May 17, 2005 Share Posted May 17, 2005 I downloaded automysqlbackup and am able to access it using a cron (i put the automysqlbackup into etc/ ). But I am getting this error: etc/.automysqlbackup.sh: line 572: /bin/mail: Permission denied Were you able to successfully run it? And if so, does it matter which directory it resides in? I do receive the cron email (as set up in the cpanel). Quote Link to comment Share on other sites More sharing options...
musiclc Posted May 17, 2005 Share Posted May 17, 2005 (edited) Well, I was able to get it working (by not using the send mail feature), but I am unable to use the "mail logs" or "mail attachment" feature within automysqlbackup . I have the backups being built in a directory I created "backups" in the same directory as "etc" "www" .... Is this directory not publicly visible, even by accident, or would somewhere else be more secure? thank you Edited May 17, 2005 by musiclc Quote Link to comment Share on other sites More sharing options...
musiclc Posted May 17, 2005 Share Posted May 17, 2005 the above question re directory visibility was answered by andy. Anything above public_html/files should not be publicly visible. Thanks. Anyone with any ideas re: the other questions would still be much appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
sifu Posted October 22, 2005 Share Posted October 22, 2005 An auto-backup script system like this is one of those things I was GOING TO DO, but never got around to it, so I only have a handful of backups done manually whenever I remembered to do it (I am sure I am the ONLY one in the world who has been in this situation - joking, of course ) My site has now been hacked for the second time (the world is full of nice people). So, before I rebuild, I think my lesson is learnt and I better setup something like this auto backup script. Anyway, my question, scripts like this one require CRON. I understand that earlier this year TCH stopped allowing CRON jobs, so therefore I don't think the automatic features and email features of this script will work. (?) What can we use instead of CRON ? On the business side: I am taking this auto backup matter quite seriously, and Bill, if you are reading this, I would be prepared to pay for a service such as a script like this would provide: - Daily backups - Emailed backups This sort of service could be an add-on and a differentiator for TCH. If you had enough members interested, it could allow you to keep the costs down - couple of dollars a month ? Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted October 22, 2005 Share Posted October 22, 2005 Anyway, my question, scripts like this one require CRON. I understand that earlier this year TCH stopped allowing CRON jobs, so therefore I don't think the automatic features and email features of this script will work. (?) What can we use instead of CRON ? This is not correct - TCH allows cron jobs and to my knowledge, has never disallowed or disabled them. To set one up, double-click on the 'Cron Jobs' icon in your CPanel. Quote Link to comment Share on other sites More sharing options...
stevevan Posted October 22, 2005 Share Posted October 22, 2005 My site has now been hacked for the second time (the world is full of nice people). Sorry to hear that. Yes, some people have no life! Backups are only a part of web site security. Make sure that you are running the latest updated software (wordpress, php-nuke, etc.) and their applicable patches. After all, if you back up the open door that you already have, you'll have the same "welcome mat" out when you restore your site. Quote Link to comment Share on other sites More sharing options...
sifu Posted October 23, 2005 Share Posted October 23, 2005 This is not correct - TCH allows cron jobs and to my knowledge, has never disallowed or disabled them. To set one up, double-click on the 'Cron Jobs' icon in your CPanel. Thanks David Now I am confused! I used to run a CRON for MSAnalysis under PHPNuke, for over a year, but it got disabled earlier this year. TCH's response was as follows. 31 July 2005 Hello, Commands like GET, wget, lynx have been disabled on our servers for security reason. We can not enable it. Please try using curl. Let us know if you need any other clarification. Thanks for choosing TotalChoice Hosting Sincerely, Kris B Technical Support To run php via cron, you need to use GET ? Perhaps I am missing something. Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted October 23, 2005 Share Posted October 23, 2005 GET, wget, and lynx are system commands that are used to retrieve a file or web page from another server. These commands can be called in a PHP script, and apparently one of the was in your 'MSAnalysis under PHPNuke' cron job script. It is only these commands that have been disabled on the server - not cron jobs as a whole or even php within cron jobs. Your script could modified / rewritten so that it does not use these commands, then it could be used again in a cron job. Hope this helps... Quote Link to comment Share on other sites More sharing options...
sifu Posted October 24, 2005 Share Posted October 24, 2005 Thanks David for clearing that up. I will now explore this auto backup script as it seems like a very good idea to me. Whilst we are on the subject of cron, is it possible to run a home dir backup via cron ? Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted October 24, 2005 Share Posted October 24, 2005 Whilst we are on the subject of cron, is it possible to run a home dir backup via cron ? You might take a look at the forum topic "Cronjob Of Cpanel Backup". Quote Link to comment Share on other sites More sharing options...
MarkMan Posted April 1, 2006 Share Posted April 1, 2006 Has anyone who's been using the automysqlbackup.sh script run into a problem recently? It is now throwing an error for me after having run with no problem for almost 2 months on server 109. I even grabbed the script file from an old site backup (when it ran no problem) and it is now throwing the error below. Tech support says it's probably a syntax error in the script and referred me here. But the script hasn't been touched and now it's failing? Note that the same script is running fine, and has been for 6 months, on Server 5 (same MySQL version 4.1.13-standard) Any suggestions, maybe a server-side change of some sort? -thanks >/home/<username>/etc/automysqlbackup.sh: line 32: : command not found /home/<username>/etc/automysqlbackup.sh: line 35: : command not found /home/<username>/etc/automysqlbackup.sh: line 38: : command not found /home/<username>/etc/automysqlbackup.sh: line 41: : command not found /home/<username>/etc/automysqlbackup.sh: line 45: : command not found /home/<username>/etc/automysqlbackup.sh: line 49: : command not found /home/<username>/etc/automysqlbackup.sh: line 57: : command not found /home/<username>/etc/automysqlbackup.sh: line 60: : command not found /home/<username>/etc/automysqlbackup.sh: line 63: : command not found /home/<username>/etc/automysqlbackup.sh: line 64: : command not found /home/<username>/etc/automysqlbackup.sh: line 68: : command not found /home/<username>/etc/automysqlbackup.sh: line 71: : command not found /home/<username>/etc/automysqlbackup.sh: line 74: : command not found /home/<username>/etc/automysqlbackup.sh: line 77: : command not found /home/<username>/etc/automysqlbackup.sh: line 80: : command not found /home/<username>/etc/automysqlbackup.sh: line 83: : command not found /home/<username>/etc/automysqlbackup.sh: line 86: : command not found /home/<username>/etc/automysqlbackup.sh: line 89: : command not found /home/<username>/etc/automysqlbackup.sh: line 92: : command not found /home/<username>/etc/automysqlbackup.sh: line 307: date: command not found /home/<username>/etc/automysqlbackup.sh: line 308: date: command not found /home/<username>/etc/automysqlbackup.sh: line 309: date: command not found /home/<username>/etc/automysqlbackup.sh: line 310: date: command not found /home/<username>/etc/automysqlbackup.sh: line 311: date: command not found /home/<username>/etc/automysqlbackup.sh: line 312: date: command not found /home/<username>/etc/automysqlbackup.sh: line 314: date: command not found /home/<username>/etc/automysqlbackup.sh: line 317: : command not found /home/<username>/etc/automysqlbackup.sh: line 350: syntax error near unexpected token `{ ' /home/<username>/etc/automysqlbackup.sh: line 350: `dbdump () { ' Quote Link to comment Share on other sites More sharing options...
anand4linux Posted April 20, 2006 Share Posted April 20, 2006 dude, I read the script and i dont think is worth the time discussing or editing the script You can do this. /usr/bin/mysqldump is normally having execute permission and if TCH has not changed it you can run this from bash . mysqldump --databases DB1 DB2 ....... > $HOME/mysqltestdump.`date +%d-%m-%Y` this will create dumps when ever you run the above command, and if you need to delete previous older ones, its just a couple of lines . No need for the script being discussed above Anand S Earlier remote sysadmin Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted April 20, 2006 Share Posted April 20, 2006 And with no shell access your solution will not work. But welcome the forums Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted April 20, 2006 Share Posted April 20, 2006 Welcome the forum, anand4linux. Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted April 20, 2006 Share Posted April 20, 2006 Welcome the forum, anand4linux Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted April 20, 2006 Share Posted April 20, 2006 Welcome to the forums Anand. Quote Link to comment Share on other sites More sharing options...
anand4linux Posted April 21, 2006 Share Posted April 21, 2006 Thanks Bruce, Thomas, Don, and Tim, I'd post a better sh script, but I think shell scripts are against your AUP. Anand S Quote Link to comment Share on other sites More sharing options...
abinidi Posted April 21, 2006 Share Posted April 21, 2006 Anand, Welcome to the forums! If you have any questions about if a certain script would be allowed, I'd recommend that you contact the help desk, or send a PM to one of the RED staff members. They should be able to respond to specific scripts that would be allowed or disallowed as per the AUP. Don't be a stranger in the forums! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.