Need Help Mirroring Data
I have allready setup public keys with no password.
I have a server behind the corporate firewall, I can connect to the server at my house using a ssh connection. I hate to ask for someone to draw this out for me, but I am not all linux complient. Just for ease of use I'd like to do the following. Compress two directorys then rsynce them to the server at my house and then uncompress them. I know that I need to use a script for this, but like I said I dont know all these commands. I have tried rsync with no luck as I must be doing something wrong. |
Take a look at these LinuxAnswers:
http://www.linuxquestions.org/questi...ticle&artid=79 http://www.linuxquestions.org/questi...ticle&artid=80 |
Thanks david, I have been going by your guides. The public key is done.
This is the command that I am running. rsync -e ssh -avz --delete-after root@165.247.000.000:/home/midgett/drawings /home/backup I am not sure what order to put the directorys. Which one is source and which one is the offsite directory? I have to start the connection from the host side as it is behind a firewall and I have to tunnel through the VPN. Second note: Can you help me use linux to connect through our cisco 501 PIX? I have the vpn client software for windows. [root@backupsvr root]# rsync -e ssh -avz --delete-after root@165.247.000.000:/home/midgett/drawings /home/backup receiving file list ... done wrote 16 bytes read 51 bytes 26.80 bytes/sec total size is 0 speedup is 0.00 [root@backupsvr root]# |
Just as with a copy command the source is always first - ie:
cp /path/to/source /path/to/destination So this: rsync -e ssh -avz --delete-after root@165.247.000.000:/home/midgett/drawings /home/backup Copys from the remote machine to the local machine. I've never used Cisco PIX VPN what problems are you having with it? |
Here is the latest.
[root@backupsvr root]# rsync -e ssh -avz --delete-after root@165.247.000.00:/home/backup/ /home/midgett/drawings/ receiving file list ... link_stat /home/backup/. : No such file or directory done client: nothing to do: perhaps you need to specify some filenames or the --recursive option? rsync error: partial transfer (code 23) at main.c(594) I am still getting nothing from the host to the client. What am I doing wrong? |
first question though. when i just cp'd your script here, i noticed where your at. now are you going into your server, at home, and then dropping it to work? or are you at work dropping it to your house?
now if your at work and bringing it from home back to where you're at, this would be the script- # rsync -e ssh -avz --delete-after user@home:~/home/backup/ /home/midgett/drawings/./ if your at work and you want to drop it at home, then it's this- [root@backupsvr root]# rsync -e ssh -avz --delete-after /home/midgett/drawings/ root@165.247.000.00:~/home/backup/./ hoepfully that makes some sense to you. the thing that one of the other gentlemen forgot to tell you about the direction, is that you have to put what you want moved before the address of where it's going, like the second script. as to the first, you had to put the user of the or campus box in to get what you wanted and then bring it back to where you are at. i always use the ./ so that i don't overwrite anything, that way your system knows to put it in that directory and not name the target dir what you are bringing to it. i also use the ~ even though it's not really necessary on your script, especially if your going from work to home with the data. actually it wouldn't really matter. cheers. |
Thank you for stopping by to lend a hand. I tried what you were talking about and this is the results that I got. Oh I am droping files from work to my home server.
[root@backupsvr root]# rsync -e ssh -avz --delete-after /home/midgett/drawings/./ root@165.247.000.000:~/home/backup/./ building file list ... link_stat /home/midgett/drawings/./. : No such file or directory done wrote 25 bytes read 20 bytes 18.00 bytes/sec total size is 0 speedup is 0.00 rsync error: partial transfer (code 23) at main.c(578) I know that on the client box the dir is /home/midgett/drawings/ |
Please do the following:
ls /home/midgett/drawings/ if the result is not a bunch of file ok, fine... :-) Usualy when rsync is issuing that kind of message it is because no files are found... Dont give up!! |
This is the destintination directory. There shouldn't be any files there untill this runs. The directory is there if that what you are looking for.
|
Quote:
rsync -e ssh -avz --delete-after root@165.247.000.000:~/home/backup/ /home/midgett/drawings/ No ?? It should be like a regular copy Rsync source destination... Well that's how it worked with my tests ... :rolleyes: |
This is the error that I got when I tried your way.
[root@backupsvr root]# rsync -e ssh -avz --delete-after root@165.247.000.000:~/home/backup/ /home/midgett/drawings/ receiving file list ... link_stat /root/home/backup/. : No such file or directory done client: nothing to do: perhaps you need to specify some filenames or the --recursive option? rsync error: partial transfer (code 23) at main.c(594) I also tried it with out the ~ so it didn't use the root dir. |
So, what is the result of your ls when you shh ???
You have to have the right absolute path Hint: Normaly, on a standard setupit might be /home/[USERNAME]/backup... try to determine what is the right path from / and then put that path on you command ... |
I know that!
Its right I have checked 3 times. The directorys are there its just not copying the files. |
Quote:
If you want to copy the "/home/backup" directory to "/home/midgett/drawings/" on your local machine then: rsync -e ssh -avz --delete-after root@165.247.000.000:/home/backup /home/midgett/drawings/ |
I am on my local machine in the office and want it to connect to remote at the house. I can ssh in fine. I have to start the connection from this side b/c i can not get from the outside in on the VPN in linux. If am on a windows puter I can get on the VPN and conect to the office. But this has really nothing to do with my problem. Now from the computer that is hosting the files I am running
rsync -e ssh -avz --delete-after root@server:/home/ /home/ ok I have figured this out. But I still need help. This command above copyed everything from my home server to my backup server at the office. I had the office server start the connection. How can I get this to run the other way around. I need to copy from the work server to my home server, but the connection has to be made from the work server to the home server b/c of the VPN. |
All times are GMT -5. The time now is 06:59 PM. |