How to FTP files of perticular pattern.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to FTP files of perticular pattern.
# 1  
Old 03-25-2009
How to FTP files of perticular pattern.

Hi,

I have a almost 4000 files in a perticular directory, but i want to ftp only todays files to some other unix server, not all the files.

could you please help me on this.

file formates are,

Code:
-rw-r--r--   1 pipe     pipe            341 Mar  9 12:35 ALTIMUS_BILL09MAR2009_1222_36499.DAT
-rw-r--r--   1 pipe     pipe        2925001 Mar  9 13:35 BILL09MAR2009_1302_36469.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 13:35 ALTIMUS_BILL09MAR2009_1333_36518.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 13:35 ALTIMUS_BILL09MAR2009_1328_36517.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 14:05 ALTIMUS_BILL09MAR2009_1403_36520.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 15:05 ALTIMUS_BILL09MAR2009_1443_36522.DAT
-rw-r--r--   1 pipe     pipe            598 Mar  9 15:40 BILL09MAR2009_1506_36506.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 15:40 BILL09MAR2009_1506_36501.DAT
-rw-r--r--   1 pipe     pipe            855 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36509.DAT
-rw-r--r--   1 pipe     pipe          22186 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36508.DAT
-rw-r--r--   1 pipe     pipe           5481 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36507.DAT
-rw-r--r--   1 pipe     pipe         155826 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36506.DAT
-rw-r--r--   1 pipe     pipe          19873 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36504.DAT
-rw-r--r--   1 pipe     pipe           8308 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36503.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36502.DAT
-rw-r--r--   1 pipe     pipe          50970 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1506_36501.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 15:40 ALTIMUS_BILL09MAR2009_1505_36523.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 16:35 ALTIMUS_BILL09MAR2009_1634_36530.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 16:35 ALTIMUS_BILL09MAR2009_1632_36529.DAT
-rw-r--r--   1 pipe     pipe            341 Mar  9 16:35 ALTIMUS_BILL09MAR2009_1631_36528.DAT


Last edited by Yogesh Sawant; 03-25-2009 at 06:32 AM.. Reason: added code tags
# 2  
Old 03-25-2009
Code:
#!/usr/bin/ksh

today=$(date "+%d%b%Y"|tr "[a-z]" "[A-Z]")
ftp -n -v <unix_server_id> <<-FTP
user <user-id> <password>
prom
mput *${today}*
bye
FTP

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script for FTP folder pattern

Hello, I have 3 folders on FTP server in the format yyyymmddhhmiss as below,ftp> cd /home/walgreens 250 CWD command successful ftp> ls 200 PORT command successful 150 Opening ASCII mode data connection for file list 20150708072901 20150708092901 20150708102901The above folders are in... (1 Reply)
Discussion started by: pavan_test
1 Replies

2. UNIX for Dummies Questions & Answers

How to download files matching pattern from FTP using CURL or WGET?

Hi, For an order I requested, the provider has uploaded a tar file in public FTP site which internally has tons of files (compressed) and I need to download files that follows particular pattern which would be few hundreds. Note: The order can't be requested for files that follows the... (7 Replies)
Discussion started by: Amalan
7 Replies

3. Programming

Can someone summarize what exactly this perticular code is doing

#include<stdio.h> #include<string.h> int main() { char a={0,1,2,3,4,5,6,7,8,9}; printf("\n--%s-- unable to access values",a); printf("\n--%d %d-- able to access through direct acess",a,a); printf("\n--%d-- but the failing to read the size\n",strlen(a)); return 0; } (2 Replies)
Discussion started by: hk108
2 Replies

4. Shell Programming and Scripting

Find required files by pattern in xml files and the change the pattern on Linux

Hello, I need to find all *.xml files that matched by pattern on Linux. I need to have written the file name on the screen and then change the pattern in the file just was found. For instance. I can start the script with arguments for keyword and for value, i.e script.sh keyword... (1 Reply)
Discussion started by: yart
1 Replies

5. UNIX for Dummies Questions & Answers

copying a pattern of files in one directory into other with new pattern names...

Hi, I have to copy a set of files abc* in /path/ to /path1/ as abc*_bkp. The list of files appear as follows in /path/: abc1 xyszd abc2 re2345 abcx .. . abcxyz I have to copy them (abc* files only) into /path1/ as: abc1_bkp abc2_bkp abcx_bkp .. . (6 Replies)
Discussion started by: new_learner
6 Replies

6. Shell Programming and Scripting

to get list of files of a perticular range of time

hi, how to list the files which has been created or accessed before 6 months thanks (1 Reply)
Discussion started by: useless79
1 Replies

7. UNIX for Advanced & Expert Users

how to know that a perticular process is started!!!

Hi all, I wanted a write a script which will start executing whenever a particular process will starts running in a background. Is there is any way in Unix if a directory contents changed then a signal/Interrupt will generated and by taking status of that interrupt I can execute some scripts.... (11 Replies)
Discussion started by: zing_foru
11 Replies

8. Solaris

how to restrict the perticular commands to users

Hi all, How to restrict the perticular commands to users(or perticular users) in solaris10? Could you please assist me the precedure for above issue. Thanks & Regards krishna (0 Replies)
Discussion started by: krishna176
0 Replies

9. UNIX for Dummies Questions & Answers

space in perticular folder in unix

can any one tell me how to know the free space in perticular folder in unix. size in bytes/MB. thanks in adv. spandu (7 Replies)
Discussion started by: spandu
7 Replies

10. UNIX for Advanced & Expert Users

find files with a perticular year of access

Hello all, Might be a silly question, on my AIX machine the year had changed to 2022 and some files were accessed on this date hence the time stamp on these files is with year 2022, there are many such files. i want to list all these file from the root dir and subdir with 2022 year... (3 Replies)
Discussion started by: pradeepmacha
3 Replies
Login or Register to Ask a Question