简体   繁体   中英

When configuring daily backups, which files should I include to be sure I have the MySQL db's

I have a dedicated LAMP server with cpanel hosting 100 websites (some of them have MySQL db's).

I am currently using the Jungle Disk Server Edition to backup our files from our LAMP server to Amazon S3.

Once a week were are backing up the entire cpanel which is an enormous strain on resources but that is a separate issue.

Now, what I want to do is to set up a daily job to backup just the HTML files and the MySQL db's.

If I just backup the "public_html" folder will my MySQL database info be stored in that directory? Would backing up the public_html folder be enough to recover the db?

I can find plenty of resources online about how to manually backup MySQL db's but with a 100 sites, I need it automated. I'm hoping for an easy solution where I can just grab a folder to backup each day.

If I just backup the "public_html" folder will my MySQL database info be stored in that directory? Would backing up the public_html folder be enough to recover the db?

No, definitely not. The MySQL data files are usually located in something like /var/mysql .

But you probably shouldn't be backing up the data files directly anyway. It's better to create dumps using mysqldump (or mysqlhotcopy ) and backup the resulting dumps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM