Sunday, 15 February 2009

Updated ways to skin a cat

As luck would have it, I was prompted to look at an old blog entry of mine (June 2006) at a previous employer.

I was pleasantly surprised to see Barry Chase has updated the PLSQL FTP Solution in the interim.

Thanks for the heads-up and the credit, Barry :-)

Monday, 18 June 2007

Many ways to skin a cat

At a previous employer, I posted thusly:
Implementing an FTP server in PL/SQL

More recently I was involved in an upgrade project (Oracle 817 to Oracle10g, WinNT/Win2K to Win2k3 plus new servers, new network).
Before the upgrade there was a daily batch file process to fetch files from a remote ftp server. As far as we know, there were never any problems with this process.

After the upgrade, the process would intermittently fail with a dropped connection, regardless of when the process was run.

I had been contemplating implementing the process in Oracle to gain control over which files had been fetched and where necessary, restart the process.
A colleague of mine had been trying various FTP tools without much success, which prompted me to take another look at my favourite ftp tool WinSCP.

As it turns out, it is now possible, using the newer versions, to automate WinSCP activities with scripts. WinSCP's return codes integrate better with DOS batch files, unlike the native Windows ftp client.
Add to this WinSCP's ability to reconnect after a connection failure and you have a fairly robust means of fetching files via a scheduled task.

My implementation now uses WinSCP v4 in a DOS batch file to fetch all available files from the remote server, then delete the originals only if the fetch was completely successful.