exec Remote server?

I use this code to remove old backupfiles on the local system.

exec('/usr/bin/sudo find /backup/daily-con* -mtime +7 -exec rm {} \;')

I would also like to run this command on a remote system that is on the same network. (192.168.1.50)

My question is can this be done and if so how.

Thank you for your time.

William

Look into ssh keys. Once you've set that up you can simply run your commands through ssh (without having to log in.)