Sponsored Content
Top Forums Shell Programming and Scripting Deleting a file from REMOTE Unix Server Post 302249891 by jyoung on Wednesday 22nd of October 2008 09:42:30 AM
Old 10-22-2008
Using a script you could ftp the files to a local directory then create another ftp to delete them. Below is a script that I use:
Code:
ftp -in 00.00.00.00 <<End-Of-Session
user user_id pass_word
type ascii
cd outbound
lcd /lsf1/law/logan/OWENS/temp
mget *
quit
End-Of-Session
cat /lsf1/law/logan/OWENS/temp/* > /lsf1/law/logan/OWENS/OM810
if [[ -s /lsf1/law/logan/OWENS/OM810 ]]; then
   echo 'ftp -in 00.00.00.00 <<E-O-F' > /law1/lawson/logan/edi_bin/om810ftp
   echo 'user user_id pass_word' >> /law1/lawson/logan/edi_bin/om810ftp
   echo 'type ascii' >> /law1/lawson/logan/edi_bin/om810ftp
   echo 'cd outbound' >> /law1/lawson/logan/edi_bin/om810ftp
   cd /lsf1/law/logan/OWENS/temp/
   ls | while read filename
   do
     echo 'delete ' $filename >> /law1/lawson/logan/edi_bin/om810ftp
   done
   echo 'quit' >> /law1/lawson/logan/edi_bin/om810ftp
   echo 'E-O-F' >> /law1/lawson/logan/edi_bin/om810ftp
   . /law1/lawson/logan/edi_bin/om810ftp
   rm /lsf1/law/logan/OWENS/temp/*
   cp /lsf1/law/logan/OWENS/OM810 /lsf1/law/logan/edi_arch_inb/OM810.inb."$(date +%Y%m%d%H%M%S)"
else
    echo "File OM810 not found or is empty"
	return 12
fi
exit

 

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

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

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

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

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

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

9. UNIX for Beginners Questions & Answers

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... (2 Replies)
Discussion started by: abhi_123
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 06:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy