exec Remote server?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting exec Remote server?
# 1  
Old 07-23-2009
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
# 2  
Old 07-23-2009
Look into ssh keys. Once you've set that up you can simply run your commands through ssh (without having to log in.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

4. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

5. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

6. Programming

SFTP from one remote server to another remote server from desktop

Hi, I have 1. lappy 2. server A 3. server B Now, what i need is to run a command from lappy that will sftp a file from server A to server B. Please guide me to achieve this. -akash (1 Reply)
Discussion started by: akash.mahakode
1 Replies

7. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

8. Shell Programming and Scripting

remote execution of find -exec

Hi folks I am working on a script which lists files of a specific pattern on a remote m/c and tar&zip them to another remote m/c via a centralized server. M/C details: remote1 - OSF1 vayu V5.1 2650 alpha remote2 - cygwin based windows server central - SunOS phys-chenab 5.8... (2 Replies)
Discussion started by: royalbull
2 Replies

9. Shell Programming and Scripting

ssh and remote command exec `uname -r`

Hi guys, I am trying to do a ssh for performing a set of actions. Find it below: I need to put the user/ kernel/ DISTRO variables before I complete this operation. what I observed is when ever I put a `command` in those quotes, it performs thta action in local system rather than remote one.... (5 Replies)
Discussion started by: jbmukund
5 Replies

10. AIX

Remote Exec

Dears we have an application that try to excute commands via using a (rexec.dll) to connect to an AIX box and running commnds but when we try to do that then the connection will be rejected by the AIX box, are there any pre-configurations or settings that must be done in order to gain the... (1 Reply)
Discussion started by: TheEngineer
1 Replies
Login or Register to Ask a Question