Jump to content

Newbie assistance with trivial task


nitro7
 Share

Recommended Posts

I have a trivial script that I need to get written, but my mind is having a hard time getting started.

Here is what I need to do, I need to download via FTP several files from different FTP servers each day. The files are presented in a format such as this:

show-MM-DD-YY.mp3

Here is an example of the command line using wget to get one of the files.

wget --ftp-user=USERID--ftp-password=USERID ftp://ftp.SERVER.com/fr-10-25-11.mp3

After I download the file I simply need to move the file here is the command line for the example above.

mv fr-10-25-11 c:\radio\daily_spots\forreal\For_Real_with_Jamey_Ragle.mp3

There is about a dozen spots that need downloaded daily and moved. This all needs to happen at midnight.

Any pointers in the right direction greatly appreciated.

Thank you,

Clint

Link to comment
Share on other sites

I'd decide what fields you need to keep track of, and then, to make updating easy, build youself some sort of delimited text file.

For instance, I put one together with fields for: show, ftpaddress, userid, password, and destinationfolder, like this:

; FORMAT: showtitle|ftpaddress|userid|password|destinationfolder
Breaking Bad|ftp:\\123.123.123.123\Public|anonymous||c:\temp
The Daily Show|ftp:\\234.234.234.234\Incoming|user99|password99|c:\temp

Then something like this to process it:

#include <Array.au3>
Global $aShowData, $sShowList = @ScriptDir & "\showlist.dat"
; ==============================================================================
If Not FileExists($sShowList) Then
MsgBox(16, "I/O Error", "Showlist.dat file not found")
Exit
EndIf
$file = FileOpen($sShowList)
While 1
    $aShowData = FileReadLine($file)
    If @error = -1 Then ExitLoop
If $aShowData = "" Or StringLeft($aShowData, 1) = ";" Then ContinueLoop; ignore blanks lines or ; comments
Process_Show()
Wend
FileClose($file)
Exit
; ==============================================================================
Func Process_Show() ; do your stuff here
$aShowData = StringSplit($aShowData, "|")
_ArrayDisplay($aShowData)
EndFunc

I'm sure there's something already in AutoIt that can replace wget.

PS - Welcome to the forum!

Link to comment
Share on other sites

....

I'm sure there's something already in AutoIt that can replace wget.

Try InetGet.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...