listing files on remote server


 
Thread Tools Search this Thread
Operating Systems AIX listing files on remote server
# 1  
Old 05-31-2008
listing files 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-02-2008
are you using rexec command ?
# 3  
Old 06-02-2008
If the rsh connectivity is there between the machine... then do this way

rsh REMOTE_IP $DIR_NAME/<command>

e.g.
rsh 10.15.1.19 /home/user1/ls

Hope it will work !!!
# 4  
Old 06-02-2008
file count on remote machine

No
I can connect to the remote machine and can view the files.
But when i tried to get the count of files for a particular month, the command we usually use is `ls -ltr *200805" | wc -1`. This gets the count of files for the 200805(yyyymm). But when i put the same command on remote machine the error out is "ls remotefile localfile". Its asking me to get the count on the local file. But if i do this, i have to come out of the ftp , check the count in local file, and if greater then zero, again login to ftp location. This will be a pain. I want to check the count at FTP location only and if greater than zero get the files onto my local machine.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Tarring files to remote server

Hi, I need to tar some files in a directory to a remote server. I need to exclude some file from this directory and then tar it over. This is the command suggested by one article (tarring in the same server) : tar -zcvf /tmp/mybackup.tar.gz -X exclude.txt /home/me However it does not... (9 Replies)
Discussion started by: anaigini45
9 Replies

2. 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

3. 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

4. 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

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. Shell Programming and Scripting

Listing Files and Sizes on FTP server

Need assistance in getting File size for the List of files using perl script . I have writtern 2 codes. One of them gives me the list of files and 2nd one give me the size for only 1 file. I dont know how to club both of them to get the list of files with its size . #!/usr/bin/perl -w... (11 Replies)
Discussion started by: ajayram_arya
11 Replies

7. UNIX for Dummies Questions & Answers

Long listing of files using find command on remote server via SSH

Hi , I am trying to find some files on a remote machine using the find command. >ssh -q atukuri@remotehostname find /home/atukuri/ -name abc.txt /home/atukuri/abc.txt The above command works fine and lists the file, but if I want to do a long listing of files (ls -l) its not working . ... (2 Replies)
Discussion started by: atukuri
2 Replies

8. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

9. UNIX for Dummies Questions & Answers

Listing all files on FTP Server

Hello, I am the definition of UNIX newbie so please bare with me. I am wondering the best way to list all files on a ftp server. If I use curl -l ftp://user:password@ftp_server This shows me the root of the ftp server, but I would like to get a listing of everything in the subfolders ... (7 Replies)
Discussion started by: Dallasbr
7 Replies

10. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies
Login or Register to Ask a Question