[Tfug] bash dl script
Nate
nate at torzo.com
Wed Aug 27 09:58:10 MST 2008
Of course there are always ways to make it more difficult... I've never
done socket programming in bash, but I wouldn't be surprised if it's
possible. With shell scripting, though, it's all about using the tools
already at your disposal. As someone else said, curl also works on the
command line. I'm an old Perl hacker, so a lot of times I will use GET,
which is installed along with LWP. I'm sure there are other command
line utilities that would work, too.
Nate
christopher wrote:
>
>
> On Mon, 25 Aug 2008 14:40:20 -0700
> Nate <nate at torzo.com> wrote:
>
>> script.sh
>> -----------------------
>> #!/bin/sh
>>
>> # Get date... see 'man date' for format string
>> DATE=`date +"%Y-%m-%d"`
>> URL="http://www.somesite.com/files/some_file_$DATE.ext"
>> OUT="/tmp/some_file_$DATE.ext"
>>
>> wget -O $OUT $URL
>> -----------------------
>>
>> chmod +x script.sh
>>
>> Then cron it to run, like every 5 minutes:
>>
>> */5 * * * * /path/to/script.sh
>>
>> Adjust everything as needed of course.
>
> Wow, it's that simple? Thanks. I've been trying to do
> more things with scripts, but I didn't think it would
> be that simple. Thanks. I'll let you know if I run into
> any probs
>
More information about the tfug
mailing list