Here's a last try before you'll have to consult your Unix guru:


It appears that the redirect command doesn't work under cron (so much for my fine assumption! -- my apologies!! :^). Following is a crontab entry and a short script that works for me:

Crontab entry:
49 20 * * * root /home/myhome/test.sh

test.sh (make sure you chmod a+x test.sh so it's executable!):
#!/bin/sh
curl -dump http://some.com > /home/myhome/file`date +"%m%d%y%H%M%S"`.txt

Some things to watch out for:
1. include the path to your script or cron won't be able to find it!
2. the crontab entry above tells cron to execute the script as root. You might want to make another user in case of some security issue (after you get it working :^)
3. I've used curl in my script -- wget seems to get the whole html file more reliably, but it works differently than curl. You could e-mail me offlist if you'd like to try that.


I sure hope this works!! Let me know...

Scott

Steve Miller wrote:

Scott,

1. Made all the corrections, but no file was created.
2. I then simply set the filename to file.txt instead of file`date
+"%m%d%y"`.txt and the file WAS created. So, there is something wrong with
the date-appending syntax.

Thanks for your help...any other ideas?

steve







Here are some notes -- there are a couple problems with your code:
15 19 * * * curl -dump http://www.firstdomain.com/files/filename.phtml >
http://www.seconddomain.com/home/rommys/seconddomain-www/files/file'date
+"%m%d%y"'.txt

1. Not sure about "curl" -- never used it, but it appears you can use a
URL
2. The embedded date command needs to be quoted with the <b>back-tick</b>, not
the single quote:  `date +"%m%d%y"`  not 'date +"%m%d%y"'
3. You need to give a real unix path name for the redirection, not a url:
someunixcommand > /unix/path/finename
4. Everything needs to be on one line, no line-feeds or carriage returns.

So it should look like this (without the line breaks):
15 19 * * * curl -dump http://www.firstdomain.com/files/filename.phtml >
/path/file`date +"%m%d%y"`.txt

I'm assuming you have access to that Unix server since you're using cron,
and that you just want to store the files on that same server.

Also, try the command on the command-line to make sure it works...

Let me know how it goes --
Scott





____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub


________________ http://www.wdvl.com _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]








____ • The WDVL Discussion List from WDVL.COM • ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub

________________ http://www.wdvl.com _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to