I have the following in my crontab to sync my folders on the servers as they are run on round robin DNS settings it syncs every minute.
* * * * * rsync -ar --delete -e ssh user@skynet.rizzler.se:/home/user/folder1/ /home/user/folder1/ >/dev/null 2>&1
* * * * * rsync -ar --delete -e ssh user@skynet.rizzler.se:/home/user/folder2/ /home/user/folder2/ >/dev/null 2>&1
This Rsync works for small files, but it's getting bigger so I am wondering how I can get this into a script, put that script into my crontab and each time the script is run, it will check if it's running. If the script is running, it will do nothing; if it's not running, it should go ahead and start the rsync.
Anyone know how I can do this?