proskater123 Posted April 5, 2010 Share Posted April 5, 2010 So I have two Linux machines. Both running Centos Linux. One is running Plesk and the other I built to be a central backup server. I was reading about rsync but I didn't think rsync ran on the central server and pulled from the different servers out on the internet. So my final goal is that I want a central backup server that goes out and pulls information off of the servers that are at different locations. I don't want to do full backups of the system either. I just want to backup directorys that I choose. For example one of the directorys would be /var/www/vhosts/ and everything under that. Would you recommend rsync or would you use something else? What command would you use and why? Quote Link to comment Share on other sites More sharing options...
Burning Aces Posted April 5, 2010 Share Posted April 5, 2010 (edited) cp -a [directory here] eg cp -a /home/getabetternick/ would copy your home Edited April 5, 2010 by Burning Aces Quote Link to comment Share on other sites More sharing options...
proskater123 Posted April 5, 2010 Author Share Posted April 5, 2010 But that doesn't help me. I know how to copy a directory. lol. But for remote backup. I need say my home directory backed up to a remote server. Actually that remote server backup my home folder. Quote Link to comment Share on other sites More sharing options...
Charles Posted April 5, 2010 Share Posted April 5, 2010 Could try Rsync. That would work. Quote Link to comment Share on other sites More sharing options...
Blue Dragon Posted April 5, 2010 Share Posted April 5, 2010 Well, try rsync in combination with ssh. Mount the remote server's files system using sshfs, then use rsync to copy the files to your local server. Put it all into a nice bash-script that you can run over night using cron. Quote Link to comment Share on other sites More sharing options...
Charles Posted April 5, 2010 Share Posted April 5, 2010 Well, try rsync in combination with ssh. Mount the remote server's files system using sshfs, then use rsync to copy the files to your local server. Put it all into a nice bash-script that you can run over night using cron. Yup, that would do the trick. Quote Link to comment Share on other sites More sharing options...
VaKo Posted April 5, 2010 Share Posted April 5, 2010 Rsync or SCP + cron jobs are they only way to go. Quote Link to comment Share on other sites More sharing options...
X3N Posted April 5, 2010 Share Posted April 5, 2010 either cp + tar or rsync... i prefer rsync cause its faster and can do incremental backups... theres also this totally awesome program that will do snapshotting of linux drives not using LVM called hotcopy... r1soft makes it and distributes it free... Quote Link to comment Share on other sites More sharing options...
proskater123 Posted April 6, 2010 Author Share Posted April 6, 2010 With rsync is it possible to have my central server go out and pull the files from the servers out on the internet or do the servers that I want backed up have to send there files to the central server? Quote Link to comment Share on other sites More sharing options...
X3N Posted April 6, 2010 Share Posted April 6, 2010 With rsync is it possible to have my central server go out and pull the files from the servers out on the internet or do the servers that I want backed up have to send there files to the central server? theres mulitple ways to do this... the easiest way is to use rsync daemon the other way is to stream it over ssh using cron and shell scripts... for speed i would just use the daemon but if you wanted to be real secure about it you could run it from a shell script... and you can either pull or push the files accross rsync supports both methods... for real secure enviroments i usually have a SAN pull the backups from the machines that need to backed up in order to prevent access to the san by the machines... that allows you to run multiple backups on one central SAN without giving the client access to the storage. Quote Link to comment Share on other sites More sharing options...
proskater123 Posted April 6, 2010 Author Share Posted April 6, 2010 So tell me if this would be the correct usage. rsync -r bob@someserver.com:/copy/this/directory /copy/to/this/directory But how do I do it over ssh Quote Link to comment Share on other sites More sharing options...
Charles Posted April 6, 2010 Share Posted April 6, 2010 Check here: http://troy.jdmz.net/rsync/index.html Quote Link to comment Share on other sites More sharing options...
proskater123 Posted April 6, 2010 Author Share Posted April 6, 2010 (edited) Actually I did find that page. I am currently going through it right now Edit: So I am very happy to say that I have figured out rsync. I feel like a Linux Genius. :P But now another question arises. Since I am running Plesk on the machine that I am backing up; what files/ directory should I backup? I am already backing up the /var/www/vhosts folder. But what files mage the dns, the users, the mysql, and anything else. I just want to get it so that if my server ever crashes for any reason, I can have it backup and working the way it was with all the settings and files before. Thanks for all the help also :D Edited April 7, 2010 by proskater123 Quote Link to comment Share on other sites More sharing options...
Blue Dragon Posted April 8, 2010 Share Posted April 8, 2010 Why not copy everything? I mean, if your're running rsync, you can get everything on the first run and then only copy the files that changes every day. Quote Link to comment Share on other sites More sharing options...
X3N Posted April 12, 2010 Share Posted April 12, 2010 try this without quotes. Rsync has be to on both machines. Also if you want to automate this using a shell script then you'll need to create a public/private keypair using ssh in order to do a passwordless login. "rsync -arz --delete -e ssh bob@someserver.com:/copy/this/directory /copy/to/this/directory" and if you want to see every file your are copying add a v like this "rsync -arzv --delete -e ssh bob@someserver.com:/copy/this/directory /copy/to/this/directory" and if you want to check how much space the entire copy uses "du -ch /copy/to/this/directory" 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.