Monday, April 18, 2011

FTP Script from the command line

For the longest time I have always used wget to handle command line ftp downloads.

For one particular download I was doing wget stopped working with wildcards.  Probably something to do with the server I was connecting to.

I started researching and found a cool windows batch file to do this:


Windows server 2003 and Windows XP – How to script file download from FTP server


Here is the script from the example altered for my needs.

@echo off
echo user MyUserName> ftpcmd.dat
echo MyPassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo prompt>>ftpcmd.dat
echo cd IDX>>ftpcmd.dat
echo mget pics-*-2*.tar>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat SERVERNAME.COM
del ftpcmd.dat

Monday, April 11, 2011

Javascript date format

I thought it weird that Javascript didn't / doesn't really have an easy way to format Dates.  I ended up using the first link.