LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-02-2006, 04:56 PM   #1
dlublink
Member
 
Registered: Oct 2004
Location: Canada
Distribution: Ubuntu
Posts: 330

Rep: Reputation: 30
rsync mirroring with SSH


All,

I have the command to do the sync:

rsync -avz --bwlimit=20 -e ssh --stats --progress /var/mail/virtual root@myhiddenhost.mydomain.net:/var/mail/

I would like to rsync automatically. I read about running a daemon, but it seems that running a daemon makes a new server and listens on a port. I would like the sync to happen automatically.

Am I best using a crontab? What's the best way to make sure that program doesn't run at the same time as itself?

Thanks,

David

Last edited by dlublink; 05-02-2006 at 05:12 PM.
 
Old 05-02-2006, 10:07 PM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
I am doing an automatic rsync each night between two Linux servers. The script runs from the crontab and connects using ssh. To be sure that you don't step on the running script, have it create a lockfile (usually I write the PID of the script to this file). At the beginning of the script, test for the existance of the lockfile and abort if it exists (meaning the script is already running).
 
Old 05-03-2006, 08:18 AM   #3
dlublink
Member
 
Registered: Oct 2004
Location: Canada
Distribution: Ubuntu
Posts: 330

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by centauricw
I am doing an automatic rsync each night between two Linux servers. The script runs from the crontab and connects using ssh. To be sure that you don't step on the running script, have it create a lockfile (usually I write the PID of the script to this file). At the beginning of the script, test for the existance of the lockfile and abort if it exists (meaning the script is already running).
This is what I have setup, just seeing the words "rsync daemon" made me think their might be a better way to do it.

Turns out "rsync daemon" is for serving files on a network.

David
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Server mirroring ? rsync Bluesuperman Linux - Networking 3 04-25-2006 10:12 PM
rsync and ssh? IchBin Linux - Newbie 4 02-13-2005 03:41 PM
Rsync vs ssh satimis Linux - Software 7 04-04-2004 06:58 AM
Rsync and SSH Phaethar Linux - Software 3 03-22-2004 03:18 PM
Mirroring servers using RSYNC RKris Linux - Networking 1 05-15-2003 06:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration