dont want to ftp file which has been already ftpied


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting dont want to ftp file which has been already ftpied
# 1  
Old 08-30-2012
dont want to ftp file which has been already ftpied

Code:
 
curr_time=`date +%Y%m%d%H%M`
curr_date=`date +%Y%m%d`
zero=0
script_path="/home/wccuser1/wcc/Scripts/bulk_file_ftp"
file_dir="/home/wccuser1/wcc/Bulk_Files"
todays_file_count=`ls -ltr | grep $curr_date | awk '{print $9}' | wc -l`
todays_file=`ls -ltr | grep $curr_date | awk '{print $9}'`
log_count=`grep $curr_date bulk_file_ftp.log |wc -l`
if [ $todays_file_count -ne $zero ]; then
cd /home/wccuser1/wcc/Scripts/bulk_file_ftp
ftp -in -v 10.99.99.99 <<eof1>> /home/wccuser1/wcc/Scripts/bulk_file_ftp/bulk_file_ftp.log
user username air1234
bin
lcd /home/wccuser1/wcc/Scripts/bulk_file_ftp
cd /wcc_cdr01/misuser/wcc/ftp/log_file_ftp/10.77.0.21
mput *$curr_date*
cd /wcc_cdr01/misuser/wcc/ftp/log_file_ftp/10.77.0.23
mget *$curr_date*
bye
eof1
fi
fi

this code has one constraint , i do not want to ftp the file which has been once ftpied , what changes do i require
# 2  
Old 08-30-2012
I can se that you are writing the out put of ftp command to a log file... Cant you just check for the last file which got ftp'ied and start from that file onwards....

selecting the file from last file onwards u can take many routes... wither awk,sed etc (once u list the file names)....

Give it a try if wont work please let us know...
# 3  
Old 08-30-2012
k boss, i will try that, thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find file dont have that string

I have 13 text files and almost all of them contain the same string. but some file has diffrent string inside. I want to send that file which has a diffrent string inside (11 Replies)
Discussion started by: Sagar Singh
11 Replies

2. UNIX for Dummies Questions & Answers

How to find a file if we dont know exact location of file ?

Hi I want know "How to find a file if we dont know exact location of file ?" Thanks, Tushar Joshi:) (9 Replies)
Discussion started by: tusharjoshi
9 Replies

3. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

4. Shell Programming and Scripting

Extract columns from a file if the name dont exist put blank

Hi, I am very new to Unix script. Suppose i have a file with column header: NAME1 NAME2 Address Tel And I always need to make a file with column header: ID NAME1 NAME2 EMail Address Tel For the columns that do not exist in the file, I would still like to make a column with blank. ... (11 Replies)
Discussion started by: nightrider
11 Replies

5. Shell Programming and Scripting

Substitution in a file dont work with an Array in filename

Hi. I´ve a script that should substitude the 8th line in a file called xxx.num6. The "xxx" is set by an array filled with this command: j=0 for Par in *.sys ; do Par=`echo $Par | sed 's/\(.*\).sys/\1/'` ; Par2="$Par" ; echo "${Par2}" j=$((j + 1)); done Now i try... (0 Replies)
Discussion started by: Lock3
0 Replies

6. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

7. AIX

Dont want to change the codepage of a unicode file

I have a unicode file which needs to be modifed in an AIX environment from within a shell (ksh). I am concerned that the modification may involve a change in the file's codepage. Is my concern correct ? If so, whats the way around ? Thanks in advance. (0 Replies)
Discussion started by: shibajighosh
0 Replies

8. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

9. UNIX for Dummies Questions & Answers

mv command if you dont know the full name of the file

Hi all. I have a problem renaming a file. It is called "data_200711051002.csv" (for example) and I want to rename it automatically to "data.csv" in a routine in a program named Ascential. Those numbers are a time stamp, so every time the file is loaded into the server, they will change. ... (2 Replies)
Discussion started by: absolutdani
2 Replies

10. SCO

compressed file was ftpied in ascii mode needs recovery

I am unbale to uncompress a file which was compress then moved to another pc in ascii mode instead of binary mode. Is there any way to recover it. Please help us. While uncompress it is giving corrupt input. (3 Replies)
Discussion started by: raj2610
3 Replies
Login or Register to Ask a Question