scan directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting scan directory
# 8  
Old 03-06-2009
Sorry, I didn't have any time to answer you.
I will give you a solution during the week-end (full of work today too).

Don't worry Smilie
# 9  
Old 03-09-2009
ok

ok Goldorakk. i'm waiting.
# 10  
Old 03-09-2009
hi

ls ./ascii -r>dir_list.txt
for MYFILE in `awk '{ print $1 }' files_list.txt`
do
for MYDIRFILE in `awk '{ print $1 }' dir_list.txt`
do
#if [[ $MYFILE = $MYDIRFILE ]]OB
if expr "$MYDIRFILE" : ".*$MYFILE" != 0
then
if [[ $MYFILE != $MYDIRFILE ]]
then
mv ./ascii/$MYDIRFILE ./ascii/$MYFILE
fi
echo "Preparing to send file $MYDIRFILE"
fi
done
done


---------------------
this is what i did to collect the files tobe transfered.
my proble m now is to send the files with CFT.
Can u help me ?
pourrais-tu m'aider ?
ich bin .... ? Smilie
# 11  
Old 03-10-2009
Well you have at least minimum 2 solutions.
But I'm full of work and I have to take time to explain you the possible solutions.
Please wait this evenig (in France) for my answer.

Sorry for the delay.
# 12  
Old 03-11-2009
Well, to send a file with CFT, you must have first the good environment with path to CFT executables and other environment variables like theses :

Code:
$ env | grep CFT
CFTACNT=/home/cft/fillog/cft_acnt
CFTACNTA=/home/cft/fillog/cft_acnta
CFTCATA=/home/cft/fildat/cft_cata
CFTCOM=/home/cft/fildat/cft_com
CFTDIRADX=/home/cft/filadx
CFTDIRAPI=/home/cft/filapi
CFTDIRDAT=/home/cft/fildat
CFTDIREXE=/home/cft/filexe
CFTDIREXI=/home/cft/filexit
CFTDIRHOME=/home/cft/
CFTDIRINQ=/home/cft/fildat
CFTDIRINS=/home/cft/filinst
CFTDIRLIB=/home/cft/fillib
CFTDIRLOG=/home/cft/fillog
CFTDIRNOT=/home/cft/filnotes
CFTDIRPUB=/home/cft/filpub
CFTDIRSEC=/home/cft/filsec
CFTDIRUSR=/home/cft/filusr
CFTFICNF=/home/cft/filint/default.cfi
CFTFIDIR=/home/cft/filint
CFTHADIR=/home/cft/fildat
CFTHICNF=/home/cft/filint/default.sei
CFTHIDIR=/home/cft/filint
CFTHINI=/home/cft/fildat/sec.ini
CFTHPARM=/home/cft/fildat/secparm
CFTLOG=/home/cft/fillog/cft_log
CFTLOGA=/home/cft/fillog/cft_loga
CFTPARM=/home/cft/fildat/cft_parm
CFTPART=/home/cft/fildat/cft_part
CFTPKIDIR=/home/cft/filsec/pki
CFTPKU=/home/cft/filsec/pki/pkibase
CFTTRKCNF=/home/cft/fildat/trkapi.cfg

If you don't have them, search the "ENV_CFT" file and source it.

After, to send a file, you have to use CFTUTIL like this :
Code:
$ CFTUTIL send part=partnerid,IDF=idtrf,FNAME=/full/path/to/file/to/send

I you didn't define a CFTSEND parameter in CFT, and sending a text file, you must use "FTYPE=T" in the command.

Now, if I understand correctly your script, you have to do this :
Code:
$ cd ascii
$ for file in $(ls)
do
    CFTUTIL send part=SABDE,IDF="%%E",FNAME=$(pwd)/${file},FTYPE=T,PARM=$file
done

On the other side (partner SABDE), you will find the original name of the file in the CFT variable "&PARM" (without the path).

To see the status of your transfers, use the command:
Code:
CFTUTIL listcat part=SABDE

OK ? Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create automated scan of specific directory using bash

I am trying to use bash to automate the scan of a specific directory using clamav. Having this in place is a network requirement. The below is an attempt to: 1. count the extensions (.txt, .jpeg) in a directory and write them to a virus-scan.log (section in bold) 2. scan each folder in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. UNIX for Dummies Questions & Answers

best way to scan?

i want to scan all open and closed ports on a server. how can i do this. i intend on using nmap, but if there are better ways to do it, please let me know. i understand there are a total of 6335 allowable ports on a server. so out of that 6335, i want to know which is open or closed. id... (1 Reply)
Discussion started by: SkySmart
1 Replies

3. AIX

Scan Rate

Hello, How can i tell ifthe ratio between fr and sr is ok? is fr/sr ratio of 0.9 acceptable? thanks. (1 Reply)
Discussion started by: LiorAmitai
1 Replies

4. Red Hat

Scan For new LUNS

In Solaris the administrator has to update /kernel/drv/sd.conf file to tell the sd driver to scan for a broader range of scsi devices. Can someone please tell me what file needs to be update in Redhat Linux 5 for the same. Second part of the question is WWN for HBA's can be found (atleast in my... (1 Reply)
Discussion started by: Tirmazi
1 Replies

5. Shell Programming and Scripting

scan compressed

Hello all I want to help I have some compressed files on the system When you want to unzip these files Delete any file which symlink "ln -s" {{ I need script is necessary Script contain: Any operation to decompress the system is doing to delete any symlink... (0 Replies)
Discussion started by: x-zer0
0 Replies

6. Shell Programming and Scripting

A script to scan a directory for XML files,

Hi, I am fairly new to unix/linux scripting (about 1 week) and have written a script to scan a directory for xml files, if found call and oracle procedure passing in the file name and then move the file once processed to an archive area. Now everything seems to be working except when there... (3 Replies)
Discussion started by: apacheuk
3 Replies

7. Shell Programming and Scripting

Scan directory and sub directories

I am really stuck on a issue and have not been able to find a solution. With the code below I need to not only scan the current directory which as you can see below is... /lcl/sit/apps/Tivoli/ But I also want it to scan all sub directories it finds under Tivoli as well for the same thing... (2 Replies)
Discussion started by: LRoberts
2 Replies

8. UNIX for Dummies Questions & Answers

scan and move

i have a script to look for a file, but it moves a file that's being used. i want to use: if file exists > 0, and not being updated/used in the last 2 minutes, move to /tmp i can do this much: if then mv filename.txt /tmp else exit fi or how can i check if... (3 Replies)
Discussion started by: tjmannonline
3 Replies

9. UNIX for Advanced & Expert Users

Please let me know Regarding Port Scan

Can any one please let me know below ones 1) How to Perform the Port Scan in Solaris Environment and how to block the unwanted Ports. 2) How to know whether particular Port is listning the requests or not? Thanks Ramkumar.B (7 Replies)
Discussion started by: myramkumar
7 Replies

10. UNIX for Dummies Questions & Answers

IP Name scan

Hi. how to search a range of IP:s for their registed IP names? Like nslookup or host for all IPs 130.xxx.xxx.1 to 130.xxx.xxx.254 //nicke (2 Replies)
Discussion started by: nicke30
2 Replies
Login or Register to Ask a Question