# exec Remote server?

**URL:** <https://community.unix.com/t/exec-remote-server/245319>\
**Category:** Shell Programming and Scripting\
**Created:** [July 23, 2009, 10:20am UTC](https://community.unix.com/t/exec-remote-server/245319 "2009-07-23T10:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imager](https://community.unix.com/letter_avatar/imager/32/6_449c533f586939b6e5f246632a46421f.png) [@imager](https://community.unix.com/u/imager)\
**Post date:** [July 23, 2009, 10:20am UTC](https://community.unix.com/t/exec-remote-server/245319/1 "2009-07-23T10:20:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kodak](https://community.unix.com/letter_avatar/kodak/32/6_449c533f586939b6e5f246632a46421f.png) [@kodak](https://community.unix.com/u/kodak)\
**Post date:** [July 23, 2009, 1:38pm UTC](https://community.unix.com/t/exec-remote-server/245319/2 "2009-07-23T13:38:18Z")

</div>

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