ls -ltr command On Remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ls -ltr command On Remote server
# 1  
Old 05-31-2008
ls -ltr command On Remote server

I am writing a script where in i have to log into a remote machine and check for necessary file by typing (ls -ltr *200505) (this gets all 05month of 2008 yr files) and if files are found get them to the local machine. If not found print a message saying no files on local machine.
When i was trying to accomplish this , i was able to log in to the remote server but cannot write ls -ltr command on remote server. When i tried , it says "Remote file local file" i couldnt understand. Please help.
# 2  
Old 06-01-2008
Hammer & Screwdriver Regarding your issue

Hi,

Actually i think first you have to connect to the remote server and then see for your existence of it trough if command and if found then you cn use the move command and move it across to some temporary file and then transfer it across to the other server using the scp command... I thinkthis sould work..
# 3  
Old 06-01-2008
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. UNIX for Beginners Questions & Answers

How to run command on remote server?

Hi I am trying to write a script which when I run from server A it execute few command on another server say B and show me the output. below is the script but it is not showing me the o/p of B machine but instead showing me A machine o/p every time. #!/bin/bash for i in `cat... (14 Replies)
Discussion started by: scriptor
14 Replies

3. Shell Programming and Scripting

I have two commands “ls -h” and “ls -ltr”. How do i make sure “ls -ltr” is run after “ls -h” is suc

help me (2 Replies)
Discussion started by: sonu pandey
2 Replies

4. Shell Programming and Scripting

Printing Year in ls -ltr command

Hi, When retrieving parameters of a file using ls command i need to print the year part . When i do ls -ltr the following output is displayed -rwxrwxrwx 1 d_infd d_infd 1711 Jan 8 2004 wf1.class. Here the year part is not displayed only Jan 8 is displayed. Can any one... (9 Replies)
Discussion started by: ragugct
9 Replies

5. UNIX for Dummies Questions & Answers

Executing ls command in remote server

Hi Guru, I have a requirement where i need to list the *.csv files in my remote server and copy a file from that server to my unix server I wrote dis code #!/bin/sh . /home/aaa/bb/GlobalHost.sh export HOST export USER export PWD ftp -n $HOST <<END_SCRIPT quote USER $USER quote... (1 Reply)
Discussion started by: pssandeep
1 Replies

6. Shell Programming and Scripting

ls command in Remote Server

Unix Box: IBM AIX Shell : K-Shell When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this. What is want is get into the remote server and get the count of required... (6 Replies)
Discussion started by: vasuarjula
6 Replies

7. Solaris

Running command on Remote server

Hi, I have username/password for a remote server. I would like to have list of filenames and their size in a particular directory of remote server. Now Problem is - I can not use rsh command as I can not modify rhost file of remote server. Thanks in advance. Sanjay (1 Reply)
Discussion started by: sanjay1979
1 Replies

8. AIX

ls command in Remote Server

Unix Box: IBM AIX Shell : K-Shell When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this. What is want is get into the remote server and get the count of required... (0 Replies)
Discussion started by: vasuarjula
0 Replies

9. UNIX for Dummies Questions & Answers

what does the ls -ltr command list

Hi, THe following is the output when i run the command ls -ltr can anyone explain the meaning of the field in red -rw-r----- 3 orca orca 20924 Sep 08 19:21 BTL027SASI.gnt -rw-r----- 3 orca orca 20924 Sep 08 19:21 BTL027RITD.gnt -rw-r----- 3 orca orca ... (2 Replies)
Discussion started by: ranjita.c
2 Replies

10. Shell Programming and Scripting

remote server command in a job

I need a cron job to shut services running on other nodes, do some db maintenance, then restart the remote services. This is HP-UX 11.00. I cannot get remsh to work, even interactively. Per man page, does not prompt for password. I get: remsh appserver -l oracle stop_services remshd:... (2 Replies)
Discussion started by: Jimbo
2 Replies
Login or Register to Ask a Question