Sponsored Content
Top Forums Shell Programming and Scripting AIX system.... deleting files in remote directory after retrieving files Post 302501816 by vinayparakala on Saturday 5th of March 2011 12:43:52 AM
Old 03-05-2011
AIX system.... deleting files in remote directory after retrieving files

Hi Friends,
I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out .....I am struggling likeSmilie Please help me on this code

sftp ...........@........... <<EOF
cd /home/............../DEV/HCL
get INVOICE*.xml /home/lidadm/ariba/invoice
quit
EOF
ls invoice/INVOICE*.xml >> filelist.txt ( from here is the mistake I guess )
while read N
do
echo >>todo.lst rm $N
done < filelist.txt
echo >>todo.lst quit
sftp ..........@........... < todo.lst
rm /home/............../DEV/HCL/&N
rm todo.lst
rm filelist.txt
Thanks in advance,
Vinay.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Accidentally deleting directory/files

Hi, I accidentally deleted a big directory with all its sub-directories and bunch of source code files which I have been developing for about 2 years... What will I do now, how can I retrieve my files, directory hierarchy back ??? If anyone, please HELP ! ! ! ... (4 Replies)
Discussion started by: milhan
4 Replies

2. Shell Programming and Scripting

shell script: deleting files from a directory

i have the following problem: use shell script: Two directories have to be searched for files havin the same name. then delete these files from one of these directories. the directory names have to be accepted as command line arguments. what i have done till now is: 1. run a loop... (1 Reply)
Discussion started by: onlyc
1 Replies

3. Shell Programming and Scripting

deleting empty files in a directory

Hello Gurus, I want to delete only empty files (files with 0 bytes) at once from the local directory. Rightnow I need to go through all the files one by one manually and check the empty files before deleting them. Is there any unix command that finds and deletes empty files in a directory?... (5 Replies)
Discussion started by: berlin_germany
5 Replies

4. UNIX for Dummies Questions & Answers

deleting specific lines from all files in a directory

I have a directory full of text data files. Unfortunately I need to get rid of the 7th and 8th line from them all so that I can input them into a GIS application. I've used an awk script to do one at a time but due to the sheer number of files I need some kind of loop mechanism to automate... (3 Replies)
Discussion started by: vrms
3 Replies

5. Linux

deleting only directory not files

Hi Guys, I want to know wheather it is possible to delete directory not files, Example: In one directory there are 10 dirs and 100 files but my req is to delete only dirs not file Wheather it is possible ? (13 Replies)
Discussion started by: manoj.solaris
13 Replies

6. UNIX for Dummies Questions & Answers

deleting all the files inside a directory from a relative path

I have a file inside abc/def/ghi directory. let say a.txt I need to delete this a.txt from abc itself. I have tried ls /abc/def/ghi | xargs rm -r its saying rm: a.txt non-existent also tried rm -rf /def/ghi but in vein. plz help :) (2 Replies)
Discussion started by: gotam
2 Replies

7. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

8. Shell Programming and Scripting

Script for deleting files and directories when the file system reaches the threshold

Hi Can someone assist in writing a script. I have a filesystem named /sybase in my aix lpar. When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
Discussion started by: newtoaixos
7 Replies

9. Shell Programming and Scripting

Shell : deleting only first 2 files in a directory

I have 4 files in a directory and want to delete only first 2 files only.. $ ls -ltr total 640 -rw-r--r-- 1 user other 148779 Oct 12 10:50 file1.xls -rw-r--r-- 1 user other 148779 Oct 12 10:50 file2.xls -rw-r--r-- 1 user other 148779 Oct 12 10:50 file3.xls... (4 Replies)
Discussion started by: giridhar276
4 Replies

10. Shell Programming and Scripting

Deleting files and directory's older than 3 months

I have a qnap TS259 that is running ubuntu. Have successfully setup back scripts that are initiated by cron. I would like to create a couple scrypts that would operate on the recycle bins for both drives. Just want to be able to run the script manually that would walk through both directories... (13 Replies)
Discussion started by: mackconsult
13 Replies
Data(4) 						     Kernel Interfaces Manual							   Data(4)

NAME
Data - Contains data to be sent to remote systems SYNOPSIS
/usr/spool/uucp/LocalSystemName/D.SystemNamexxxx### DESCRIPTION
Data (D.*) files contain the data to be sent to remote systems by the uucp uucico daemon. The full pathname of a data file is a form of the following: /usr/spool/uucp/SystemName/D.SystemNamexxxx### where the SystemName directory and the SystemName portion of the file name indicate the name of the remote system. The xxxx### notation is the hexadecimal sequence number of the Command (C.*) file associated with that data file; for example, D.venus471afd8. After a set period of time (specified by the uusched daemon), the uucico daemon transfers the data file to the designated system. It places the original data file in a subdirectory of the uucp spooling directory named /usr/spool/uucp/SystemName, where the SystemName directory is named for the computer that is transmitting the file, and creates a Temporary (TM.*) file to hold the original data file. After receiving the entire file, the uucp program takes one of three actions: If the file was sent with the uucp command and there were no transfer problems, the program immediately renames the TM.* file with the appropriate data filename, such as D.venus471afd8, and sends it to the specified destination. If the file was sent with the uuto command, the uucp program also renames the temporary data file with the appropriate D.* filename. It then places the data file in the public directory /usr/spool/uucppublic, where the user receives the data file and handles it with one of the uupick command options. If there were transfer problems (such as a failed login or an unavailable device), the temporary data file remains in the spooling subdirectory. The uudemon.cleanu command, a shell script, removes these files automatically at specified intervals, or they can be removed manually. FILES
Describes accessible remote systems Contains uucp command, data, and execute files Contain instructions for file transfers Store data files temporarily after they have been transferred to a remote system Contain files that the uucp program has transferred RELATED INFORMATION
Daemons: uucico(8), uusched(8), uuxqt Commands: uucp(1), uupick(1), uuto(1), uux(1), uudemon(4) delim off Data(4)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy