[H-GEN] CRON, Scripts & files from http
Mark Suter
suter at zwitterion.humbug.org.au
Sun Nov 3 22:35:53 EST 2002
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
Paul,
> I want to have a debian box to copy a password protected file
> http://x.x.x.x/jobacct.day from a printer to 1) a folder on an
> NT4 server or 2) a directory on the debian box and rename it to
> mmddhhMMss.dat every 4 hours.
The following should download the file and place it in the
current directory with a clean date based filename.
wget --http-user=USER --http-passwd=SECRET \
--output-document=$(date +%Y%m%d-%H:%M:%S) http://x.x.x.x/jobacct.dat
Wget is a fairly common utility and may already be installed. If
it's not, "apt-get install wget" will install it.
The percent character has special meaning for cron, so you would
place the above in a shell script and invoke it from cron like
follows.
0 */4 * * * /path/to/script
Yours sincerely,
-- Mark John Suter | I know that you believe you understand
suter at humbug.org.au | what you think I said, but I am not sure
gpg key id 2C71D63D | you realise that what you heard is not
mobile 0411 262 316 | what I meant. Robert J. McCloskey
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list