Complicated one: MySQL, rsync, remote machine, local machine
I have a small, vBulletin-based, aviation forum and I would like to download regular backups using rsync to my computer (I also backup within the server).
Now, I understand rsync downloads only the changes since the last download, which is something good because I get to save bandwith. Currently, I use this command to backup my database and store it in another directory within the same server, which is kind of stupid should the entire machine crash: mysqldump --opt -Q -u db_user -p db_name > public_html/directory/file.sql
That command backs up the entire thing and sends it over to a different directory. Now here's what I want to be able to do:
I need my computer to run on a scheduled task (I'm guessing cronjob) that downloads only the new parts of the file and adds them to the one it has on disk. Then, make a copy of it to another HD, just in case one of them goes kaput.
Is this even possible or am I asking for too much?
Remote machine is running CentOS, local is running PCLOS.
Yes/No and Maybe. What you want to do is definitely doable, but the “new parts” question about rsync may not work the way you expect.
Basically, almost anything you can do from CLI can be run as a cronjob, preferably through /etc/crontab.
See “$ man crontab” and “$ man 5 crontab” for more details about using crontab.
Rather than going through the details of using rsync and rsyncd here, it would probably be more useful to you to read through some of the rsync documentation here: http://rsync.samba.org/documentation.html
* rsync tutorial: http://everythinglinux.org/rsync/
* rsync man page: http://rsync.samba.org/ftp/rsync/rsync.html
* rsyncd man page: http://rsync.samba.org/ftp/rsync/rsyncd.conf.html
* setting up ssh to avoid password prompts: http://www.jdmz.net/ssh/
Thanks for your reply. I will look into it.
|All times are GMT -5. The time now is 06:39 PM.|