Re: Probably working too hard for this cron question

2011-06-14 Thread Warren Block

On Mon, 13 Jun 2011, Kurt Buff wrote:


Per the handbook, I added

SHELL=/bin/sh

to crontab, and I also added

#!/bin/sh

as the first line in the script


Should not need both.  The first changes a default, which is bad when 
you switch to another system where that hasn't been changed.  The 
second, putting #!/bin/sh in the script, should be enough.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Probably working too hard for this cron question

2011-06-13 Thread Kurt Buff
All,

I've googled a bunch, read some freebsd.org docs, and just can't
figure this out.

I have a script that should read the current date into a variable,
append the time/date stamp at the beginning of the file created with
the date in the variable, do a bunch of cURL stuff, then append a
time/date stamp at the end of the file.

It works if I run it manually, but not from cron.

Here are the batchfile and the cron entry:

--begin script--
dt=`/bin/date +%Y-%m-%d`
/bin/date  /root/$dt-external1.txt
/usr/local/bin/curl -K /root/urls.txt  /root/$dt-external1.txt
/bin/date  /root/$dt-external1.txt
--end script--

--begin crontab--
15 12 * * */root/do-curl.sh
--end crontab--

I'm doing all of this as root, as you can see.

The job launches - I can see an entry for cURL in top - but no file in /root.

I've tried several variations on the first line of the script, but I'm
getting nowhere, though I'm sure it's something stupidly simple that
I'm missing.

What am I missing?

Kurt
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Probably working too hard for this cron question

2011-06-13 Thread pete wright
On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote:
 All,

 I've googled a bunch, read some freebsd.org docs, and just can't
 figure this out.

 I have a script that should read the current date into a variable,
 append the time/date stamp at the beginning of the file created with
 the date in the variable, do a bunch of cURL stuff, then append a
 time/date stamp at the end of the file.

 It works if I run it manually, but not from cron.

 Here are the batchfile and the cron entry:

 --begin script--
 dt=`/bin/date +%Y-%m-%d`
 /bin/date  /root/$dt-external1.txt
 /usr/local/bin/curl -K /root/urls.txt  /root/$dt-external1.txt
 /bin/date  /root/$dt-external1.txt
 --end script--

 --begin crontab--
 15 12 * * *        /root/do-curl.sh
 --end crontab--

 I'm doing all of this as root, as you can see.

 The job launches - I can see an entry for cURL in top - but no file in /root.

 I've tried several variations on the first line of the script, but I'm
 getting nowhere, though I'm sure it's something stupidly simple that
 I'm missing.

 What am I missing?

#!/bin/sh ?

-pete



-- 
pete wright
www.nycbug.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


RE: Probably working too hard for this cron question

2011-06-13 Thread Gary Gatten
Yeah Pete, kinda need that huh.  Kurt, If that turns out to be the only issue, 
don't feel bad - I've forgotten it myself several times!  I'm sure many others 
have as well!

G


-Original Message-
From: owner-freebsd-questi...@freebsd.org 
[mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of pete wright
Sent: Monday, June 13, 2011 3:25 PM
To: Kurt Buff
Cc: FreeBSD Questions
Subject: Re: Probably working too hard for this cron question

On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote:
 All,

 I've googled a bunch, read some freebsd.org docs, and just can't
 figure this out.

 I have a script that should read the current date into a variable,
 append the time/date stamp at the beginning of the file created with
 the date in the variable, do a bunch of cURL stuff, then append a
 time/date stamp at the end of the file.

 It works if I run it manually, but not from cron.

 Here are the batchfile and the cron entry:

 --begin script--
 dt=`/bin/date +%Y-%m-%d`
 /bin/date  /root/$dt-external1.txt
 /usr/local/bin/curl -K /root/urls.txt  /root/$dt-external1.txt
 /bin/date  /root/$dt-external1.txt
 --end script--

 --begin crontab--
 15 12 * * *        /root/do-curl.sh
 --end crontab--

 I'm doing all of this as root, as you can see.

 The job launches - I can see an entry for cURL in top - but no file in /root.

 I've tried several variations on the first line of the script, but I'm
 getting nowhere, though I'm sure it's something stupidly simple that
 I'm missing.

 What am I missing?

#!/bin/sh ?

-pete



-- 
pete wright
www.nycbug.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org





font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system.
/font

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Probably working too hard for this cron question

2011-06-13 Thread pete wright
On Mon, Jun 13, 2011 at 2:14 PM, Gary Gatten ggat...@waddell.com wrote:
 Yeah Pete, kinda need that huh.  Kurt, If that turns out to be the only 
 issue, don't feel bad - I've forgotten it myself several times!  I'm sure 
 many others have as well!


as someone who was fixing some brain dead cron entries he setup on
friday this morning...i agree :^)

-pete




-- 
pete wright
www.nycbug.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Probably working too hard for this cron question

2011-06-13 Thread Kurt Buff
On Mon, Jun 13, 2011 at 13:25, pete wright nomadlo...@gmail.com wrote:
 On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote:
 All,

 I've googled a bunch, read some freebsd.org docs, and just can't
 figure this out.

 I have a script that should read the current date into a variable,
 append the time/date stamp at the beginning of the file created with
 the date in the variable, do a bunch of cURL stuff, then append a
 time/date stamp at the end of the file.

 It works if I run it manually, but not from cron.

 Here are the batchfile and the cron entry:

 --begin script--
 dt=`/bin/date +%Y-%m-%d`
 /bin/date  /root/$dt-external1.txt
 /usr/local/bin/curl -K /root/urls.txt  /root/$dt-external1.txt
 /bin/date  /root/$dt-external1.txt
 --end script--

 --begin crontab--
 15 12 * * *        /root/do-curl.sh
 --end crontab--

 I'm doing all of this as root, as you can see.

 The job launches - I can see an entry for cURL in top - but no file in /root.

 I've tried several variations on the first line of the script, but I'm
 getting nowhere, though I'm sure it's something stupidly simple that
 I'm missing.

 What am I missing?

 #!/bin/sh ?

Definitely closer...

Per the handbook, I added

 SHELL=/bin/sh

to crontab, and I also added

 #!/bin/sh

as the first line in the script

But, while a file is being created, it's just

 /root/-external1.txt

not

 /root/2011-06-13-external1.txt

Kurt
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Probably working too hard for this cron question

2011-06-13 Thread Kurt Buff
Indeed. Brain fade comes with age - and long weekends with the 2 year old boy...

Kurt

On Mon, Jun 13, 2011 at 14:14, Gary Gatten ggat...@waddell.com wrote:
 Yeah Pete, kinda need that huh.  Kurt, If that turns out to be the only 
 issue, don't feel bad - I've forgotten it myself several times!  I'm sure 
 many others have as well!

 G


 -Original Message-
 From: owner-freebsd-questi...@freebsd.org 
 [mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of pete wright
 Sent: Monday, June 13, 2011 3:25 PM
 To: Kurt Buff
 Cc: FreeBSD Questions
 Subject: Re: Probably working too hard for this cron question

 On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote:
 All,

 I've googled a bunch, read some freebsd.org docs, and just can't
 figure this out.

 I have a script that should read the current date into a variable,
 append the time/date stamp at the beginning of the file created with
 the date in the variable, do a bunch of cURL stuff, then append a
 time/date stamp at the end of the file.

 It works if I run it manually, but not from cron.

 Here are the batchfile and the cron entry:

 --begin script--
 dt=`/bin/date +%Y-%m-%d`
 /bin/date  /root/$dt-external1.txt
 /usr/local/bin/curl -K /root/urls.txt  /root/$dt-external1.txt
 /bin/date  /root/$dt-external1.txt
 --end script--

 --begin crontab--
 15 12 * * *        /root/do-curl.sh
 --end crontab--

 I'm doing all of this as root, as you can see.

 The job launches - I can see an entry for cURL in top - but no file in /root.

 I've tried several variations on the first line of the script, but I'm
 getting nowhere, though I'm sure it's something stupidly simple that
 I'm missing.

 What am I missing?

 #!/bin/sh ?

 -pete



 --
 pete wright
 www.nycbug.org
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org





 font size=1
 div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 
 0in 1.0pt 0in'
 /div
 This email is intended to be reviewed by only the intended recipient
  and may contain information that is privileged and/or confidential.
  If you are not the intended recipient, you are hereby notified that
  any review, use, dissemination, disclosure or copying of this email
  and its attachments, if any, is strictly prohibited.  If you have
  received this email in error, please immediately notify the sender by
  return email and delete this email from your system.
 /font


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org