Results 1 to 8 of 8

Thread: Rsync Help

  1. #1
    Join Date
    Jun 2005
    Posts
    52

    Rsync Help

    Hello,

    rsync -avbe ssh --delete /backup/* [email protected]:/home/username/backups/
    I am currently using the above command to rsync backups to a remote server, and it works fine.

    However, when it is running rsync sucks up all of the available bandwidth so the server seems to slow down. Is there anyway of limiting rsync's transfer rate, to say 500KB/s?

    Also, is there anyway to make it run in the background so that I can log out of the shell while it runs?


    Cheers,

    Steve.

  2. #2
    `man` is your friend.

    --bwlimit=KBPS

    If you plan to run it every night, just run it in a script so you don't have to worry about running in background manually.

  3. #3
    Join Date
    Jun 2005
    Posts
    52
    Originally posted by slhost
    `man` is your friend.
    I always thought Google was my best friend.

    Originally posted by slhost
    If you plan to run it every night, just run it in a script so you don't have to worry about running in background manually.
    Thanks, but I would still like to know how to run it in the background to expand my linux knowledge. Is it possible to manually run it in the background?


    Cheers,

    Steve

  4. #4
    Use an ampersand ( & ) after the command to run in the background.

    Example: ./script.sh &

  5. #5
    Join Date
    Mar 2004
    Location
    Europe
    Posts
    54
    I always like to put nohup at the front of the command and then & at the end. nohup will make sure the the command is completely finished even if you are logged out of ssh. The & sign runs the command in the background.
    Using nohup also generates a nohup,out file where all output from the command is sent so you can keep up to date with how far it has got by using tail nohup.out.

  6. #6
    Join Date
    Dec 2001
    Location
    Netherlands
    Posts
    780
    or just use screen


    Experienced OpenStack Admin For Hire
    regular as admin0 on freenode IRC on #openstack and #openstack-ansible channels

  7. #7
    Join Date
    Sep 2005
    Location
    Essex, England
    Posts
    548
    Use screen, you'll feel more confident.
    I'd still use cron though, and put the output to a file somewhere (perhaps have it e-mailed to you). The advantage is there is no human error where cron is involved.

  8. #8
    Join Date
    Oct 2005
    Location
    Quebec
    Posts
    60
    Why not use crontab for the backup ?

    On linux you can use the command
    "nohup" which will keep the process running and output everyting that would normally go to the console into a file called nohup.out

    so you would do something like this

    nohup rsync -avbe ssh --delete /backup/* [email protected]:/home/username/backups/ &

Posting Permissions

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