putting rsync cmd into function