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 like 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
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT SUNOS
default_fs
default_fs(4) File Formats default_fs(4)
NAME
default_fs, fs - specify the default file system type for local or remote file systems
DESCRIPTION
When file system administration commands have both specific and generic components (for example, fsck(1M)), the file system type must be
specified. If it is not explicitly specified using the -F FSType command line option, the generic command looks in /etc/vfstab in order to
determine the file system type, using the supplied raw or block device or mount point. If the file system type can not be determined by
searching /etc/vfstab, the command will use the default file system type specified in either /etc/default/fs or /etc/dfs/dfstypes, depend-
ing on whether the file system is local or remote.
The default local file system type is specified in /etc/default/fs by a line of the form LOCAL=fstype (for example, LOCAL=ufs). The default
remote file system type is determined by the first entry in the /etc/dfs/fstypes file.
File system administration commands will determine whether the file system is local or remote by examining the specified device name. If
the device name starts with ``/'' (slash), it is considered to be local; otherwise it is remote.
The default file system types can be changed by editing the default files with a text editor.
FILES
/etc/vfstab list of default parameters for each file system
/etc/default/fs the default local file system type
/etc/dfs/fstypes the default remote file system type
SEE ALSO
fsck(1M), fstypes(4), vfstab(4)
SunOS 5.10 20 Mar 1992 default_fs(4)