Find the answer to your Linux question:
Results 1 to 2 of 2
fI execute the following rsync command at the console (as root), it works perfectly: PHP Code: rsync  - av  -- delete  -- progress  -- bwlimit = 5000  -- exclude =/ ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! jdh239's Avatar
    Join Date
    Sep 2006
    Posts
    55

    rsync puzzle


    fI execute the following rsync command at the console (as root), it works perfectly:

    PHP Code:
    rsync -av --delete --progress --bwlimit=5000 --exclude=/srv/www/htdocs/squirrel* /srv/www/htdocs/* 198.60.1.5:/srv/www/htdocs/ 
    HOWEVER, if I execute it within a script, it copies the files into the folder where I execute the script, instead of to the other box

    PHP Code:

    #!/bin/bash

    RSYNC_PASSWORD=mySecret
    TMPFILE
    ='/var/log/rs_transfer.txt'
    RHOST="198.60.1.5"
    #rsync -av --delete --progress --bwlimit=5000  $RHOST: >> $TMPFILE 2>&1

    rsync -av --delete --progress --bwlimit=5000 --exclude=/srv/www/htdocs/squirrel* /srv/www/htdocs/* $RHOST:/srv/www/htdocs/ 
    Any ideas as to why it does this? I am adding more lines than this to my "backup script", but this is the simplified version. Very puzzling to me as to why it copies the files locally instead of across the wire to the new box.

  2. #2
    Just Joined! jdh239's Avatar
    Join Date
    Sep 2006
    Posts
    55
    Well, I found out a way around it. I had to place every command in ` (back ticks). Not sure why, but it is working now other than my RSYNC_PASSWORD part.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •