Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: rsync not found

  1. #1
    Join Date
    May 2007
    Beans
    135

    rsync not found

    This is a script I have written to run rsync to backup all of the stuff on my server to another drive mounted in the same computer.
    Code:
    #!/bin/sh
    progname=${0##*/}
    toppid=$$
    #above used to grab the name of the script and associated
    #process id
    
    
    
    #Folders to exclude
    EXCLUDES=/media/200gdisk/rsync/exclude.txt
    #Folders to include
    INCLUDES=/media/200gdisk/rsync/include.txt
    
    
    ##Define backup path
    PATH=/media/200gdisk/rsync/test
    
    
    
    #####Rsync options to be used
    #-n dry run
    #-a archive; tells rsync to retain permissions and ownership and recursive
    #-v verbose
    #-z compress
    #--progress tells user how many files are left to be copied
    #--delete any files on the receiving side if they do not exist
    	#on the sending side
    #-t transfers modification timestamp with files
    #--include-from=FILE points to include file; this is read as exception to excludes..maybe
    #--exclude-from=FILE points to exclude file
    
    OPTS="-nvazt --progress --delete --include-from=$INCLUDES --exclude-from=$EXCLUDES "
    
    #Display statement
    echo "Preparing to backup with..."
    
    #Echo command that will run and sleep for 20 seconds
    echo rsync $OPTS / $PATH
    #sleep 20
    
    #Run actual command
    rsync $OPTS / $PATH

    When I run this script I get the following;

    Code:
    Preparing to backup with...
    rsync -nvazt --progress --delete --include-from=/media/200gdisk/rsync/include.txt --exclude-from=/media/200gdisk/rsync/exclude.txt / /media/200gdisk/rsync/test
    /media/200gdisk/rsync/server_backup.sh: 42: rsync: not found
    Can someone please help me determine what I am doing wrong here?

    Thanks,
    Cory

  2. #2
    Join Date
    Mar 2007
    Location
    Hillsboro, OR
    Beans
    169
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: rsync not found

    FWIW, rsync isn't in the base install on my 8.04.1 server. Make sure that you have rsync installed and in your path somewhere:
    Code:
    which rsync
    and if not, install it using apt. If you're planning to cron it, make sure you're using the full path(from the which command above) when calling the executable.

  3. #3
    Join Date
    Sep 2005
    Location
    Northfleet, Kent, UK
    Beans
    345
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: rsync not found

    you could also try

    locate rsync

  4. #4
    Join Date
    Mar 2007
    Location
    Hillsboro, OR
    Beans
    169
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: rsync not found

    that assumes that the locatedb is current (updatedb is the command to do that) -- although, it will find it if he's got a compiled version in, say, /opt that isn't in the path.

  5. #5
    Join Date
    Aug 2008
    Beans
    285
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: rsync not found

    On my install it is located at /usr/bin/rsync.

    You'll have to reference it absolutely. The script didn't run on my system until I put in the absolute path.



    edit: Oops, read it wrong..
    Last edited by y@w; November 3rd, 2008 at 06:11 PM.

  6. #6
    Join Date
    May 2007
    Beans
    135

    Re: 117,000 files

    I changed the script to reference it's absolute location /usr/bin/rsync and the dry run indicates that it worked. I am quite suprised at the amount of files ~117,000 files according to what the dry run told me. Maybe I'm not excluding enough directories. Here are my exclude and include files.

    Include
    Code:
    /var/
    /home/
    /usr/
    /etc/
    Exclude
    Code:
    /var/cache/
    /var/tmp/
    /bin/
    /boot/
    /cdrom/
    /dev/
    /initrd/
    /initrd.img*
    /lib/
    /lost+found/
    /media/
    /mnt/
    /opt/
    /proc/
    /root/
    /sbin/
    /srv/
    /sys/
    /tmp/
    /vmlinuz*
    Any suggestions?

    Cory
    Last edited by cmittle; November 3rd, 2008 at 09:06 PM.

  7. #7
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,594

    Re: rsync not found

    I tried rsync from my login directory, works for me, mind you I have Samba installed so that is likely how it came to be on the path.
    SERVER: Azure datacenters, Hyper-V

  8. #8
    Join Date
    Jan 2006
    Location
    United Kingdom
    Beans
    2,787
    Distro
    Kubuntu 6.06 Dapper

    Re: 117,000 files

    Quote Originally Posted by cmittle View Post
    Any suggestions?
    Suggestions for what?

    If the paths you want to backup happen to have 117,000 files in them then that's that!

    Remember that after the first run rsync will only be required to backup files that have changed hence it is unlikely that it will need to redo all 117,000 every time.

    Mathew
    www.NewtonNet.co.uk - Now supporting IPv6!

    ~ Please don't use PM's to request assistance - post your query on the forum and share the discussion - if you've got a problem chances are you won't be the only one! ~

  9. #9
    Join Date
    May 2007
    Beans
    135

    Re: rsync not found

    Any suggestions on directories that I'm including that maybe I shouldn't be?

  10. #10
    Join Date
    Jan 2006
    Location
    United Kingdom
    Beans
    2,787
    Distro
    Kubuntu 6.06 Dapper

    Re: rsync not found

    It's entirely up to you, but I think you've got the most important bases covered - logfiles and other variable data, user files and configuration.

    I'm not sure if you'd need to backup /usr/ though.

    All that said, are you short of space or something on your backup medium? I backup the entire drive (it takes ~6 minutes every night) then I have a near mirror-image of my entire system should the worst happen (and it did once!).

    Mathew
    www.NewtonNet.co.uk - Now supporting IPv6!

    ~ Please don't use PM's to request assistance - post your query on the forum and share the discussion - if you've got a problem chances are you won't be the only one! ~

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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