Mailing List Archive

cron command (GET & mv)
I'm using vixie-cron and I'd like to grab a gif at a specific remote
location and copy it to a specific local location at midnight every
night. Would this work?

0 0 * * * GET http://www.thedomain.com/the/path/thefile.gif && mv
thefile.gif /var/www/localhost/htdocs/images/thefile.gif

- Grant

--
gentoo-user@gentoo.org mailing list
Re: cron command (GET & mv) [ In reply to ]
Grant wrote:
> night. Would this work?
> 0 0 * * * GET http://www.thedomain.com/the/path/thefile.gif && mv
> thefile.gif /var/www/localhost/htdocs/images/thefile.gif

no it won't.

GET displays what you tell it to get to the screen (stdout) - it doesn't
save it to a file.

You can use this to your advantage however...

0 0 * * * GET http://www.thedomain.com/the/path/thefile.gif >
/var/www/localhost/htdocs/images/thefile.gif

Make sure you're *not* running this cron as root. run it as nobody if
you have to, and make sure that the destination file/path is writable by
them.

--
gentoo-user@gentoo.org mailing list
Re: cron command (GET & mv) [ In reply to ]
On Wed, Oct 13, 2004 at 08:01:47AM -0700, Grant wrote:
> night. Would this work?
>
> 0 0 * * * GET http://www.thedomain.com/the/path/thefile.gif && mv
> thefile.gif /var/www/localhost/htdocs/images/thefile.gif

No it wouldn't - unless you have a program named GET that downloads files. You should replace GET with wget or snarf or [your favorite downloader here]. Make sure the relevant program is emerged.
The other problem is that you should set a location for wget to download to, either with the -P option to set a download prefix, or -O to set a specific filename. For example, you could use this crontab line:

0 0 * * * wget http://www.thedomain.com/the/path/thefile.gif -O /var/www/localhost/htdocs/images/thefile.gif
which would download it to that file, overwriting it every day.
Tom
Re: cron command (GET & mv) [ In reply to ]
On Wed, 13 Oct 2004 08:01:47 -0700, Grant <emailgrant@gmail.com> wrote:
> I'm using vixie-cron and I'd like to grab a gif at a specific remote
> location and copy it to a specific local location at midnight every
> night. Would this work?
>
> 0 0 * * * GET http://www.thedomain.com/the/path/thefile.gif && mv
> thefile.gif /var/www/localhost/htdocs/images/thefile.gif
>
try it with wget:
0 0 * * * wget -o /var/www/localhost/htdocs/images/thefile.gif
http://www.thedomain.com/the/path/thefile.gif

--
"May the source be with you"

--
gentoo-user@gentoo.org mailing list
Re: Re: cron command (GET & mv) [ In reply to ]
Thomas Kirchner wrote:

> No it wouldn't - unless you have a program named GET that downloads files.

# qpkg -f `which GET`
dev-perl/libwww-perl *

--
gentoo-user@gentoo.org mailing list
Re: Re: cron command (GET & mv) [ In reply to ]
On Wed, Oct 13, 2004 at 11:32:59AM -0400, Billy wrote:
> # qpkg -f `which GET`
> dev-perl/libwww-perl *

I apologize - I'm not too familiar with perl. Billy's advice works too then.
Tom
Re: Re: Re: cron command (GET & mv) [ In reply to ]
> > # qpkg -f `which GET`
> > dev-perl/libwww-perl *
>
> I apologize - I'm not too familiar with perl. Billy's advice works too then.
> Tom

Works great. Thanks guys.

- Grant

--
gentoo-user@gentoo.org mailing list