Operating System - HP-UX
1753846 Members
7706 Online
108807 Solutions
New Discussion

Re: Script to write to check the file in directory if available then run the FTP transfer script.

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: Script to write to check the file in directory if available then run the FTP transfer script.

Hi (again) Narendra:

> Thanks...I don;t want the file to check whether it is in use as this file won;t we use by any users. And can we simply write the logic to check whether file is avialabe in /ftpfile/outbox directory through ll |wc -l and if it gives and output 2 then the FTP transfer script will run or else it won;t run the FTP transfer script. Or any other logic without using process id.

If you simply want to test for an empty versus non-empty directory and trigger your FTP when the directory contains something, you could do:

#!/usr/bin/sh
[ ! -z "$(ls /path/to/directory)" ] && /script/FTPtransfer.ksh

Regards!

...JRF...

Narendra Uttekar
Regular Advisor

Re: Script to write to check the file in directory if available then run the FTP transfer script.

Hi James,
Thanks a lot for your help that's what i was looking for the script.

Once again thanks...