The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rsync gurus -- how to stop rsync daemon?

Discussion in 'General Discussion' started by trakwebster, Aug 11, 2003.

  1. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    I've been very happily using rsync to make periodic backups of my server to an office machine. I decided that, since it worked so nicely, I would also use it in the other direction, to back up an office 'library' directory to my server, so as to have an off-site safety backup of our office files.

    Because our office machines sit behind a firewall, I do not have the skills to have the server call in through the firewall, so I wanted the script to run on the office machine. It appeared to fail, and then I noticed that rsync can run in a daemon mode, so I started up the rsync daemon on my server ('rsync --daemon'), and then with just a little tinkering created a script that ran on the office machine and copied the desired files onto the desired directory on the server. So far, so good.

    Now, when I am done with this action, I do not want to leave the rsync daemon running. It just goes against my grain, because it could be insecure. However, searching the rsync documentation as best I can, I cannot find any flag that stops the daemon.

    Does anybody know what the correct command would be? Or can anybody confirm that there is no such command, and in that case, please advise me of the kindest way to close a running daemon in general?

    I did a search here, but the subject appears never to have arisen before. I would be very grateful for any assistance.
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    You really shouldn't daemonize something that you don't want to run all the time. You can easily call rsync from a bash script, etc. If you want to daemonize it, there's plenty of ways to kill the process off using signals--it just depends on how nice you want to be to the process.

    You can use "killall -SIGTERM process_name" or "killall -SIGKILL process_name" on some systems you can use "killproc process_name".

    cPanel.net Support Ticket Number:
     
  3. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    You're right -- daemon not needed!

    Although my first experiments suggested that the script running on office machine could not initiate file transfer into remote server, I was mistaken.

    Using your suggestion I successfully killed the daemon process (verified with ps -aux), and then retried the office machine script which had been successful when remote daemon was running.

    This script worked fine. On the remote server, the rsync process started up. ps -aux reveals that rsync is running on the remote server as 'rsync --server -v', and all is delightful.

    For the benefit of anybody in this same situation, the script which runs on the local office machine looks like this --

    rsync --rsh=ssh --archive --delete --verbose --progress --stats /officemachinedirectory/* root@11.22.33.44:/remotedirectory/

    cyphervendor, thanks for your help.
     
    #3 trakwebster, Aug 12, 2003
    Last edited: Aug 12, 2003
Loading...

Share This Page