[PLUG] Simple wget question

Rogan Creswick creswick at gmail.com
Mon Mar 17 19:53:38 UTC 2008


On Mon, Mar 17, 2008 at 3:43 AM, kurt braget <joehaircut at gmail.com> wrote:
>
>  Your right about cd'ing in a cron job. I don't know why but I'm worried
>  about that. Seems like an ugly way to do it. But really, I can't think of a
>  reason why cd'ing wouldn't work, especially as root? I would still have the
>  same problem with the -P option if the destination directory for the
> photos changed...

I haven't checked, but presumably if wget can't write to the directory
for some reason, it won't write *anything*.  Robert C.'s suggestion
to: cd <place> && wget ...   is a good one, but any way you cut it,
using the cd in addition to wget introduces an additional (albiet
small) place for error.  (say a \n gets stuck in there, or someone
wants to insert a debug statement to see what dir is actually being
cd'd to... maybe the partition is important due to space reasons, so a
pwd or mount or ... is added between the cd and the wget, and the
error checking semantics of && is lost in the process...)

I'm of the opinion that human error is rampant, and I don't trust my
self much more than anyone else, so when possible I design solutions
to be robust to my own stupidity.   (This is also why I hack code in
haskell, rather than python.)

--Rogan



More information about the PLUG mailing list