image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old May 12th, 2003, 04:39 PM
Registered User
 
Join Date: May 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dilapidavid is on a distinguished road
rsync-ing web pages

I'm an OS X user who'd like to have a handy way to sync my web pages. I'm a total unix newbie, but I've caught onto the possibility of using rsync and/or rsyncx to do this.

Currently, I can use command-line sftp to post my stuff, but it seems I can only do one file at a time (right?).

Can someone tell me (step by step if possible) how to use rsync or rsyncx to accomplish this? (I can install, no prob. I've already installed rsyncx.)

When I use sftp, I enter:
>sftp username@server.school.edu
at which point it asks me to login.

Then I cd to my public_html directory, where I put my files. I'd love to be able to transfer and sync folders and files to this spot by entering a simple command or two. (I'm unfamiliar with writing/saving/using scripts, but if that's relevant here, let me know!)

Thanks for any help!
David

p.s.--I've read this hint and visited the macosxlabs site, but got lost and don't know how to improvise for my case.

http://www.macosxhints.com/article.p...01&query=rsync

http://www.macosxlabs.org/documentat...ve.html#rsyncx

p.p.s.--I just tried again using Rsyncx as best I could, and here's the (edited) output I got in the terminal:

me% time sudo rsync -a -e ssh "/Users/me/sites/itsc/" "username@server.school.edu:/public_html/" --nohfs --showtogo; exit
Password:
username@server.school.edu's password:
rsync: on remote machine: --showtogo: unknown option
rsync error: syntax or usage error (code 1) at main.c(842)
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
1.130u 0.100s 0:43.52 2.8% 0+0k 4+1io 0pf+0w
logout
[Process completed]

p.p.p.s.--This is very close to the script found here:
http://www.macosxlabs.org/documentat...ataVolume.html
Reply With Quote
  #2  
Old May 12th, 2003, 09:47 PM
Registered User
 
Join Date: May 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dilapidavid is on a distinguished road
Okay . . . I've actually installed rsync using fink commander (which should help!). And now, from Rsyncx, I've tried again and gotten:

time rsync -a -e ssh "/Users/davidc/sites/itsc/" "username@server.school.edu:/public_html/" --showtogo; exit
rsync: --showtogo: unknown option
rsync error: syntax or usage error (code 1) at main.c(875)
0.010u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
logout
[Process completed]
Reply With Quote
  #3  
Old May 12th, 2003, 11:09 PM
lurk's Avatar
Mitä?
 
Join Date: Mar 2002
Location: Land o' skeeterz
Posts: 2,076
Thanks: 0
Thanked 0 Times in 0 Posts
lurk is on a distinguished road
Back on the ssh side di you every try using scp like scp -r public_html username@server.school.edu:~/public_html that will recursively copy the whole directory. You can also use * as a wild card with scp you just need to protect it from the shell with quotes liek this scp "*.html" username@server.school.edu:~/public_html/MyProject/pages

Now if you get rsync going it will have the advantage of only transmitting what has changed between the two locations. I always promeise myself I will learn the exact syntax but the scp command always finished before I take the time to look it up

-Eric
__________________
Wenn ist das Nunstruck git und Slotermeyer? Ja!...
Beiherhund das Oder die Flipperwaldt gersput!
Reply With Quote
  #4  
Old May 13th, 2003, 12:41 PM
Registered User
 
Join Date: May 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dilapidavid is on a distinguished road
Well . . . I took a stab. Again, I'm limited in my understanding of what I'm trying to do (ssh scp . . . or scp . . .). Here is my latest output. Pretty much the same as before! Why's "shotogo" getting an error??

me% time rsync -a -e ssh scp "/sites/public_html/" "username@server.school.edu:/public_html/" --delete --showtogo; exit
rsync: --showtogo: unknown option
rsync error: syntax or usage error (code 1) at main.c(875)
0.010u 0.010s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
logout
[Process completed]


me% time rsync -a -e scp "/sites/public_html/" "username@server.school.edu:/public_html/" --delete --showtogo; exit
rsync: --showtogo: unknown option
rsync error: syntax or usage error (code 1) at main.c(875)
0.000u 0.010s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
logout
[Process completed]
Reply With Quote
  #5  
Old May 13th, 2003, 01:33 PM
Registered User
 
Join Date: May 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dilapidavid is on a distinguished road
Okay, I believe I figured out that you *don't* want to install rsync after installing RsyncX. After uninstalling rsync and reinstalling RsyncX, I'm to a situation where it appears my machine is understanding the commands okay, but the server is not:

[mycomputer:~] me% time rsync -a -e ssh "sites/public_html/" "username@server.school.eduublic_html/" --nohfs --delete --showtogo; exit
username@server.school.edu's password:
rsync: on remote machine: --showtogo: unknown option
rsync error: syntax or usage error (code 1) at main.c(842)
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
0.080u 0.030s 0:16.61 0.6% 0+0k 2+0io 0pf+0w
logout
[Process completed]
Reply With Quote
  #6  
Old May 15th, 2003, 02:40 AM
Registered User
 
Join Date: May 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dilapidavid is on a distinguished road
After three days and consulting several people I lucked into discovering that it was faulty syntax. (I'm trying to speak a language I don't understand!) The little slashes at the very end make all the difference. A slash at the end of the source path says "sync everything in this folder," whereas the absence of a slash says "sync this folder and its contents." But for the destination, you want to name the folder to sync *into*, with *no slash* after it--that last slash was screwing everything up.

Let that be a lesson . . .

NO!
rsync -v -ae ssh "/Users/me/sites/public_html/" "username@server.school.eduublic_html/" --delete --progress

YES!
rsync -v -ae ssh "/Users/me/sites/public_html" "username@server.school.edu:" --delete --progress

ALSO YES!
rsync -v -ae ssh "/Users/me/sites/public_html/" "username@server.school.eduublic_html" --delete --progress
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mixing hard drives while serving web pages cliche Networking & Compatibility 1 September 23rd, 2003 01:03 AM
Saving web pages for offline viewing ... App Request! ~~NeYo~~ Mac OS X System & Mac Software 16 March 10th, 2003 07:55 PM
can't access web pages with OS 10.1 iMan Mac OS X System & Mac Software 0 November 13th, 2001 01:07 PM
OS X and web pages Dubbalubagis Apple News, Rumors & Discussion 3 September 6th, 2001 08:36 AM
Unicode & greek & web pages gggrrrr!!!! AdmiralAK Mac OS X System & Mac Software 5 July 3rd, 2001 07:48 PM


All times are GMT -5. The time now is 04:20 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.