I am looking for a script that can be run nightly on my host to backup my MYSQL DB and all the files and folders... any idea if a generic script to do this where I simply insert my DB stuff and away it goes?
I was going to try this script but haven't got the time right now. Give it a try and let me know how it works. Sounds like exactly what you are wanting. http://www.tufat.com/s_mybackup_web_database_exporter.htm
Could you elaborate with specifics for me? I don't think I have backup.php and I don't know where I would I find rsync with my host... it was not in my folders. I have been manually doing this up to now and it is a pain. Do you have a walk-through that your could post. I am sure others would benefit from this too. Thanks
backup.php is in the administration folder. The original version that came with v2 of 68C was lacking so I gave it a pretty healthy overhaul and made it public. Its now included with 68C. To use the backup.php script you will need to open the file and make some changes based on your goals. I documented it pretty well so it should be straight forward. The script will only backup the database however, it doesnt do the whole site. You can set it to save a copy of the backup to a folder on your web host, ftp it or e-mail it. Since I use rsync to backup my whole site I just have the backup placed in a folder on my web host,then rsync grabs it and moves it over. rsync is a command that is on most unix systems by default. What I did was go into cpanel on my host and create a cron job that runs rsync. I will have to wait until I get home to get the specifics of the actual line I used etc. Rsync needs to be available on both the host system and the target or backup system. Aside from the 4 windows based PC's I have setup I also have my own unix box with a domain name that I use for testing various scripts etc. I run the rsync daemon on it and have it set up to only take incomming rsync connections from my web host. Then when the cron job runs on the web server and runs rsync the files are synced between my web host and my own system. using rsync is a great option but will take some work, especially if you want to use it to backup your site to your windows PC. There are windows version of rsync if I remember correctly but to use it your web host is going to need to be able to connect to your home system. My windows PC's are behind a firewall/NAT router so they have private IP's whereas my unix box sits in front of the firewall and has a public IP/Domain name so it can easily be reached from the internet. Its possible to use a system behind a NAT router but you would in essence have to set up port forwarding on it and use it as the target for rsync on the web host. You would also have to make sure the rsync daemon is running on your windows box and its up at the time the web host runs the rsync backup. You can read up on rsync here http://samba.anu.edu.au/rsync/ and there are also servers designed to take rsync file tranfers, for example http://rsync.net/
how to? I have been wrestling with an affordable site backup solution for a while... I do use the backup.php file that came with 68 and run it nightly via a cron job... But as mentioned this only backs up the databases... Well my site provider has given me a link to my daily backup file that they generate and said that I could setup an cron job to have it emailed to me offsite... now my problem is that I have attempted various methods (probably not the best) to have this file emailed to me nightly via a cron job.... but I cannot get it to work... Here is the link that I was told to use to download my backup, but I would like to instead have it emailed to an offsite email account. Can someone please direct me on how to take an link to a file and have it emailed to me? https://www.mysite.com:2083/getbackup/backup-mysite.com-12-05-2006.tar.gz Of course each day the file name is different... plus I must pass it my ftp username and password to download.... Has anyone ever used Wget or PHP's Curl? I don't understand enough about these to know if this is what I need... any help would be appreciated...
I'd be sure your backups are not in a public directory, unless you want somebody else to get it. Also, email isn't private, it could be opened by somebody else, so keep that in mind when you send your database backup and files with passwords (classifieds.php) through the web. I don't have access to my 68 code right now, but as long as the backup is being run and stored to folder you should be able to send it via email. I'll have to look at the email class and see what needs to be done for an attachment and then provide something to get you in the right direction. You might also check for ftp programs that have the ability to schedule get/put for files. I did a quick search and found 1 that has this ability. I don't know its quality but I'm sure there are others out there. http://www.emtec.com/pyrobatchftp/index.html
To automate the task you basically have 2 options, use e-mail OR have another system somewhere setup to receive your data. There are too many variables involved for anyone here to give you a step by step procedure. How often does your static site content change? It seems a bit overkill to back it up every night.
Thanks for the input ... I will consider my options... I did not mean to say daily, but weekly... of course that is overkill... but BTW in re: ___________________ There are too many variables involved for anyone here to give you a step by step procedure _________________________ I did not expect a step by step procedure... I found that asking questions in a good forum is helpful ... and generally everyone is willing to share their thoughts, ideas and suggestions... BTW I did post in the off-topic area so it should have indicated that it was not particularily related to 68 code, but as the forum states - Off-topic! I guess if you do not want to be bothered do not respond to an off-topic post ! sorry, but I felt a bit po's by that comment!
Sorry. to PO you certainly wasnt my intent. You have gotten many general responses to the question you asked yet you seem to still be asking the same question. That leads me to believe your looking for a more detailed answer which no one can give you because you havent furnished enough information for anyone to formulate a more complete answer. I will refrain from burdening you with my worthless replies, good luck.
You seem to have me confused with someone else... I have not received numerous responses to my one question posted on this topice started by someone else! So to date, I have posted 3 times in this post and 2 of them are to respond to uncalled for responses!
You never responded to my post. If you would be interested in the idea of an automated FTP program then there would be no need to post code to email the backups.