Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Get the remote server file size in UNIX Post 303001720 by abhi_123 on Thursday 10th of August 2017 02:18:45 AM
Old 08-10-2017
Get the remote server file size in UNIX

Hi All,

I am trying to sftp, get a file from remote server.
Post this we need to check the remote server file size or checksum value of the remote server file and compare it with the file size in the current server.

But I am facing issue to get the remote server file size. Could you please help me on this.
System: Sun OS 5.10
I have tried below approaches but is not working out:

1)
Code:
 sftp user@hostname << EOF
ls -l filename > filesize.txt
get filesize.txt
EOF

Gives error as couldn't stat remote file: No such file or directory

2)
Code:
ssh user@hostname "ls -l filename"

Doesn't give output as the unix prompt doesn't come back and need to kill the connection.

Could you please help me on this.

Thanks

---------- Post updated at 11:48 AM ---------- Previous update was at 09:41 AM ----------

I have resolved using below:

Code:
sftp user@hostname << EOF>/path/remote_size.txt
ls -l filename
EOF

 

9 More Discussions You Might Find Interesting

1. HP-UX

Transfer file from local unix server to remote server

want to remove the thread thanks (2 Replies)
Discussion started by: indira
2 Replies

2. Shell Programming and Scripting

Transfer file from local unix server to remote server

want to remove this thread. thanks (2 Replies)
Discussion started by: indira
2 Replies

3. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

4. UNIX for Advanced & Expert Users

Commands to copy a tar.gz file from a Remote Unix Server to Local Desktop.

Hi, Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :- ftp... (3 Replies)
Discussion started by: marconi
3 Replies

5. Shell Programming and Scripting

Deleting a file from REMOTE Unix Server

Hi All, I have a requirement where i need to remove a file from Remote system. Can any one suggest me how to do this? My requirement is, i need to archive the file in a separate system. If the remore system is having files older than 7 years, then i need to delete that files from the remote... (2 Replies)
Discussion started by: Raamc
2 Replies

6. Shell Programming and Scripting

SFTP - Get size of file on remote server

Hi, I have a requirement where I need to do SFTP connection to remote server, get the size of the file on remote server and depending on the size, i need to get the file onto local server. Is there any command in SFTP to get the size of the file. I found one in FTP but not in SFTP (2 Replies)
Discussion started by: forums123456
2 Replies

7. Shell Programming and Scripting

FTP using script not working (for transfering file from a remote unix server to windows PC.)

hi, Im using the following code for FTP #!/usr/bin/ksh ftp -v -n "10.29.45.11" << cmd user "mahesva" "mahesva123" get rtl.tar quit cmd Below is the log when i run the above code ********************************** Connected to 10.29.45.11. 220 (vsFTPd 2.0.1) 530 Please login with USER... (20 Replies)
Discussion started by: dll_fpga
20 Replies

8. Shell Programming and Scripting

Retrieving file size in a remote server using SSH

Hi, I have public and private keys and that's works fine for me. now I am sending files one by one on remote server and I want to check is file successfully delivered or not by comparing size of file on local machine and remote server using ‘stat -c%s'. Below operations need to be done on... (2 Replies)
Discussion started by: ketanraut
2 Replies

9. 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
ZOS-REMOTE.CONF(5)					  System Administration Utilities					ZOS-REMOTE.CONF(5)

NAME
zos-remote.conf - the audisp-racf plugin configuration file DESCRIPTION
zos-remote.conf controls the configuration for the audispd-zos-remote(8) Audit dispatcher plugin. The default location for this file is /etc/audisp/zos-remote.conf, however, a different file can be specified as the first argument to the audispd-zos-remote plugin. See aud- ispd-zos-remote(8) and auditd(8). The options available are as follows: server This is the IBM z/OS ITDS server hostname or IP address port The port number where ITDS is running on the z/OS server. Default is 389 (ldap port) user The z/OS RACF user ID which the audispd-zos-remote plugin will use to perform Remote Audit requests. This user needs READ access to FACILITY Class resource IRR.LDAP.REMOTE.AUDIT (See audispd-zos-remote(8)). password The password associated the the z/OS user ID configured above. timeout The number in seconds that audispd-zos-remote plugin will wait before giving up in connection attempts and event submissions. The default value is 15 q_depth The audispd-zos-remote plugin will queue inputed events to the maximum of q_depth events while trying to submit those remotely. This can handle burst of events or in case of a slow network connection. However, the audispd-zos-remote plugin will drop events in case the queue is full. The default queue depth is 64 - Increase this value in case you are experiencing event drop due to full queue (audispd-zos-remote will log this to syslog). SEE ALSO
audispd-zos-remote(8) AUTHOR
Klaus Heinrich Kiwi <klausk@br.ibm.com> IBM
Oct 2007 ZOS-REMOTE.CONF(5)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy