How to abort file transfer if the file is already existing?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to abort file transfer if the file is already existing?
# 1  
Old 11-19-2010
Question How to abort file transfer if the file is already existing?

Hi ,
while doing FTP from mainframe to unix if the file we are sending is already existing in the server ,it is getting replaced.when i used sunique command,its not replacing but stil creates a copy of the file with .1 to .99 extension.is there any way to abort the file transfer if the file is already existing in the unix server 'without creating another copy'?
Can anyone plz help me on this.
Thanks in advance
# 2  
Old 11-19-2010
Try setting read only permission to the existing file
This User Gave Thanks to ctsgnb For This Post:
# 3  
Old 11-19-2010
Question

Thank you so much for your reply.Smilie
yeah, we have to retain the existing file in the server.your first option is good.but how to check the existence of the file using ftp job (jcl program)?which command we hav to put apart from ipname,userid,pwd,binary,sendsite,put.. in the member? if the file exists it should abend also.

thanks in advance
# 4  
Old 11-19-2010
I think you are taking your problem the wrong way :
you have to design the retention rule / renaming convention rules and frequency / archiving rule / transfer frequency ... of the global transfer process, so that no such conflict occur , you should redesign your transfer process instead of developping something that kills unexpected FTP attempt : you should prevent such attempt from design.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create file and file content based existing information?

Hi Gurus, I am SQL developer and new unix user. I need to create some file and file content based on information in two files. I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies

2. Shell Programming and Scripting

Help with add existing file name as new data column in new output file

Input File 1 cat S1.txt MI0043 2731 miR-1 Input File 2 cat S4.txt MI006 310 CiR-1 MI057 10 CiR-24 MI750 5 CiR-24 Desired Output File 1 cat S1.txt.out MI0043 2731 miR-1 S1.txt Desired Output File 2 cat S4.txt.out MI006 310 CiR-1 S4.txt (3 Replies)
Discussion started by: perl_beginner
3 Replies

3. Shell Programming and Scripting

Shell Script to Abort if file name has space.

Hi, In my shell script I use the following code to copy files from one directory to other. for file in `ls`; do #----------------- Copy Files From INDIR to OUTDIR -------------# echoen "Copying File ${INDIR}/$file to ${OUTDIR}/${file}" cp ${INDIR}/$file ... (4 Replies)
Discussion started by: pinnacle
4 Replies

4. Solaris

I can't copy any file to any machine | abort problem | freezing

I want to copy tar file to another machine. tar size is 4gb. Firstly I tried copy to windows machine with ftp client but copy operation didn't start. Now I have tryied to copy to solaris machine command with scp but copy was freezed. Picture is attached.... (1 Reply)
Discussion started by: getrue
1 Replies

5. Shell Programming and Scripting

.sh file To rename existing file and copy new file

Hi All, I am very new to shell scripting . In my current task i want to create .sh file that will rename the existing file with appending _bu in it. And then copy new file . e.g if i have file linuxFirst.java then i want to rename it to linuxFirst_bu.java ..Then want replace with latest... (1 Reply)
Discussion started by: maheshkaranjkar
1 Replies

6. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

7. Shell Programming and Scripting

Need Help for Adding Three new columns in existing file from fatching data from file

not required this time (36 Replies)
Discussion started by: Sandeep_Malik
36 Replies

8. Shell Programming and Scripting

folder existing and file existing

I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file So If /myserver/myfolder/ contains a folder AND that folder conatins a .pdf file do X Else do Z I may have multiple folders and... (4 Replies)
Discussion started by: crowman
4 Replies

9. Shell Programming and Scripting

Problem in checking file abort

Hi, I would like to know given executing a file with inputs, I would like to know when does it terminate /abort abnormally. I tried to append an echo $? after executing my program which is in C. However, there is nothing..It shows 0 even though the program actually exit. my command is... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

10. UNIX for Advanced & Expert Users

examine core file after abort()

I'm running Red Hat Linux 2.6.7 on a x86_64 box. I have a core file from a program that called abort(). Does anyone here know how can I get a backtrace? (Re-creating the error with svd running inside gdb has proved impossible). % gdb svd core.25223 GNU gdb Red Hat Linux... (2 Replies)
Discussion started by: svact
2 Replies
Login or Register to Ask a Question