ftp selected jpeg files from unix filesystem

Hi All

We have hp-ux 11iv1 system running with oracle8i database.

We have around 350,000 users, each user uploaded their own signatures and are stored in unix filesystems department wise.

A database is maintained to keep their particulars with a path to link their signature files.

Now many users quit or replaced thus their account became inactive. New users added with new signatures. But old signatures are remaining in filesystems which are eating up lot of our precious disk spaces.

I am trying to write a ftp program which will first check database for the users status, if found inactive then ftp the corresponding signature files in the specified location.

Note that signature file names and user account number are identical.

I only managed to identify the signatures of the inactive users using a shell script but dont have any experience how to identify the inactive users and ftp their signatures from different folders in one go.

Thanks in advance for any help.

Neither do I, so split the problem up into

(a) identifying the inactive users

(b) identifiying their signature files

(c) ftp'ing the files

(d) presumably deleting the originals?

How to identify the inactive users using ftp cmd? Is there any way i can write SQL cmd in ftp cmd? I know shell script can do that.

No, use shell for manipulation, use SQL for database access and use FTP for transferring files.