Hi,
I need some help with writting a perl script. Here is what I need to do:
1. I need to pull down a bunch of files from an ftp server on a schedulable basis (mainly daily). The file names are all very similar in that they all start with trmasterbuild (e.g. the full file name would be something like trmasterbuild_1234.9876543
21).
2. The file transfer needs to be secure.
3. Once I pull the files from the ftp server i need to be able to delete the files I just pulled down on the ftp server (e.g. ftp file then delete file on ftp server).
4. Before I delete the file on the ftp server I need to do some kind of verification that the file I just ftped is correct. checksum???
The problem I have is that I've never written a perl script in my life and I can't seem to find any examples. I have found documentation on perl but it doesn't get into much detail on net:sftp or net::scp. All I've found was just plain documentation without examples. That's the other problem I have is that I really don't know if I should use sftp or scp or what. I've written a simple sh that will sftp the files over but it doesn't do what I need most; it doesn't do any verification on the files. Here is the sh I wrote:
#!/bin/sh
HOST='hostname.com'
FILE='*.*'
cd /home/user1/HI0001
sftp $HOST <<END_SCRIPT
cd /user1/dsisap/HI0001
prompt
mget /home/user1/HI0001/$FILE
quit
END_SCRIPT
exit
Thanks,
biglarrrr
Start Free Trial