PDA

View Full Version : Is it possible to continuously rsync-ing two folders?



CyberAngel
August 26th, 2008, 09:17 AM
Hi,

I have a client and a server. The client is collecting some data every second that I want them to be sent to the server in real time (so a cron job for periodically syncing the folders is not fitting my needs).

Is it possible to use rsync from the server, to continuously retrieving the collected data from the client and then deleting the data from the client if they have been retrieved correctly?

Thanks,
Vangelis.

dsm iv tr
August 26th, 2008, 10:18 AM
You could just write a bash script with a while loop to run rsync constantly on the server end - your very own "daemon".



#!/bin/sh

while true ; do
echo "rsync command would go here"
sleep 1 # or however many seconds you like
done




$ nice -n5 script_filename &

CyberAngel
August 26th, 2008, 10:40 AM
You could just write a bash script with a while loop to run rsync constantly on the server end - your very own "daemon".



#!/bin/sh

while true ; do
echo "rsync command would go here"
sleep 1 # or however many seconds you like
done




$ nice -n5 script_filename &


I was thinking of something like this, but I was also thinking of some other aspects like if we lose the link for a while what happens then?

Anyway I don`t think there will be a problem. I`ll try it :)

Thanks for the reply in any case!