Link to home
Create AccountLog in
Avatar of intechfs
intechfsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I run RSYNC every 5 minutes, in serial mode?

Hello,
i have a question about rsync and a cron job to run the every 5 minutes.

The problem i have it that each time rsync runs, it starts a new instance and after a couple of hours i end up with a unusable system due to the number of rsync processes running in paralell.

What i need is a way to force rsync to run in serial (one at a time), checking if an existing instance is running, and if that is the case it will not re run.

I need the script to run on this frequency because i have alot of changing data, and i want to keep the local and remote system synchronised as often as possible.
I may be looking at this problem in the wrong way, and help would be much apreciated.

thankyou!
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Hi,

In the 2nd script I did not put sleep to make it simple
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.