Is there anyway to create a script to rsync from cluster resources. I had created the script as per below but when the cluster resource failover to other server the script didnt work

#!/bin/sh

rsync -avu /media/nss/DATA/Test -e ssh root@172.18.100.22:/media/nss/DATA/

Please advise.