FTP Question

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf FTP Question

  • Creator
    Topic
  • #50918
    LaToya Butler
    Participant

      I need to ftp all files within a directory in Cloverleaf to another server within our network.  I need the name of the files to remain the same.   With the fileset-FTP protocol, you have to specify what you want to name the outbound file.  Each day the file will be name different.  

      For example, I have 3 files in a directory, say /prod/data/835.  The filenames are 090528ma.835, 090528mb.835 and 090528ca.835.  I will need to pick up these 3 files and send them to another server, but I need the name to rename the same.  Any suggestions?   Does anyone has a program that’s doing something similar to this?

      I’m on 5.3/Unix

    Viewing 4 reply threads
    • Author
      Replies
      • #68001
        Michael Lacriola
        Participant

          I had to do something like this a long time ago. Before I do research, I remember I created a tps parse directory proc which built a list of file names and set a global variable (list), put the actual file name in meta data as part of the inbound tps_proc using the same global variable (removing the value from the list as you go) and then using another tps proc to modify the OBFILE after retriveing the value from the meta data.

          I know it sounds involved, but it works. If there is an easier method, I would love to hear it. This one’s for you, Charlie.

        • #68002
          Mark Thompson
          Participant

            LaToya

            You can use a pair of TPS procs.  On the inbound thread you can get the original filename and store it in metadata USERDATA.  On the outbound thread you retrieve the filename from USERDATA and use it to override the filename that was set by fileset-local.

            Inbound:

               # Get the filename from the inbound driver control

               set driverctl [msgmetaget $mh DRIVERCTL]

               set fname “”

               keylget driverctl FILENAME fname

               set filename [file tail $fname]

               # Save file name in userdate

               set userdata [msgmetaget $mh USERDATA]

               keylset userdata FILENAME $filename

               msgmetaset $mh USERDATA $userdata

            Outbound:

               # Get the filename from USERDATA

               set userdata [msgmetaget $mh USERDATA]

               keylget userdata FILENAME filename

               # Update DRIVERCTL

               set driverctl [msgmetaget $mh DRIVERCTL]

               keylset driverctl FILESET.OBFILE $fname

               msgmetaset $mh DRIVERCTL $driverctl

            Sorry I can’t provide complete procs, but this should give you an idea how to accomplish what you want.

            - Mark Thompson
            HealthPartners

          • #68003
            Jerry Tilsley
            Participant

              I actually have a tps proc that sets the outbound filename to the same as what the inbound filename was.  That way no matter what temporary filename you give on a ftp or fileset thread, you get the original filename passed through the engine.  If you want I can upload this proc.

              Thanks,

              Jerry

            • #68004
              LaToya Butler
              Participant

                Yes, could you please upload the tcl proc.

                Jerry Tilsley wrote:

                I actually have a tps proc that sets the outbound filename to the same as what the inbound filename was.

              • #68005
                Jerry Tilsley
                Participant

                  Here is the script I always use.  I place it in the UPoC of the Route Message detail (RAW).

              Viewing 4 reply threads
              • The forum ‘Cloverleaf’ is closed to new topics and replies.