Run rsync if not running using cronjob

I want to rsync files from one server to another server every 5 minutes, but only want to start the rsync if the previous rsync command has finished. Time for one rsync depends on how much data changed on the source server, so the time taken to finish rsync cronjob varies.

Create file rsync.sh

Set cronjob like

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *