Re: Sound cron job delayed while VLC running

2018-06-08 Thread Celejar
On Fri, 8 Jun 2018 14:21:02 -0400
Greg Wooledge  wrote:

> On Fri, Jun 08, 2018 at 08:13:24PM +0200, Holger Nessen wrote:
> > I'am not sure which sound backend you are using.
> > As far as I can remember, ALSA didn't allow multiple processes to
> > output sound at the same time. 
> 
> Depends on the hardware.  If the hardware allows mixing natively, then
> you can get mixing with vanilla ALSA.  Otherwise you need userspace
> mixing, previously done by esd, nowadays done by pulseaudio.

Doesn't basic ALSA provide software mixing via the dmix plugin?

https://wiki.debian.org/ALSA#Sharing_a_card_among_multiple_processes
https://alsa.opensrc.org/Dmix

Celejar



Re: Sound cron job delayed while VLC running

2018-06-08 Thread Greg Wooledge
On Fri, Jun 08, 2018 at 08:13:24PM +0200, Holger Nessen wrote:
> I'am not sure which sound backend you are using.
> As far as I can remember, ALSA didn't allow multiple processes to
> output sound at the same time. 

Depends on the hardware.  If the hardware allows mixing natively, then
you can get mixing with vanilla ALSA.  Otherwise you need userspace
mixing, previously done by esd, nowadays done by pulseaudio.



Re: Sound cron job delayed while VLC running

2018-06-08 Thread Holger Nessen
Hi,

I'am not sure which sound backend you are using.
As far as I can remember, ALSA didn't allow multiple processes to
output sound at the same time. 

With other sound backends, e. g. PulseAudio this may change. 

However, I don't have any clue, why this problem arises just after the
upgrade. 

Best Regards,
Holger


Am Fri, 8 Jun 2018 16:33:45 +0200 (CEST)
schrieb Roger Price :

> For nearly 20 years, I have had a cron job in which a dog (yes, it's
> Biff) barks the hours.  The lines in /etc/crontab are
> 
> 0   0,12  * * *  rprice /mnt/home/rprice/bark/bark.sh 12
> ...
> 0  11,23  * * *  rprice /mnt/home/rprice/bark/bark.sh 11
> 
> In the bark.sh script, the sound is produced by sox command
> 
> /usr/bin/play -q hour12.au
> 
> I have now migrated to Debian stretch but would still like to hear
> Biff barking the hours.  The cron job works well as long as VLC is
> not running.  But while VLC runs, the cron job waits.  When VLC has
> finished, I hear the barking.  Is there some way of having the
> barking while VLC plays?
> 
> I can see nothing in VLC configuration file ~rprice/.config/vlc/vlcrc
> which prevents others from accessing the sound card at the same time.
> 
> Roger
> 
> 



Re: Sound cron job delayed while VLC running

2018-06-08 Thread Celejar
On Fri, 8 Jun 2018 16:33:45 +0200 (CEST)
Roger Price  wrote:

> For nearly 20 years, I have had a cron job in which a dog (yes, it's Biff) 
> barks 
> the hours.  The lines in /etc/crontab are
> 
> 0   0,12  * * *  rprice /mnt/home/rprice/bark/bark.sh 12
> ...
> 0  11,23  * * *  rprice /mnt/home/rprice/bark/bark.sh 11
> 
> In the bark.sh script, the sound is produced by sox command
> 
> /usr/bin/play -q hour12.au
> 
> I have now migrated to Debian stretch but would still like to hear Biff 
> barking 
> the hours.  The cron job works well as long as VLC is not running.  But while 
> VLC runs, the cron job waits.  When VLC has finished, I hear the barking.  Is 
> there some way of having the barking while VLC plays?
> 
> I can see nothing in VLC configuration file ~rprice/.config/vlc/vlcrc which 
> prevents others from accessing the sound card at the same time.

Is sound mixing generally working on your machine? Try, e.g., the dmix
test from here:

https://alsa.opensrc.org/DmixPlugin

Celejar



Sound cron job delayed while VLC running

2018-06-08 Thread Roger Price
For nearly 20 years, I have had a cron job in which a dog (yes, it's Biff) barks 
the hours.  The lines in /etc/crontab are


   0   0,12  * * *  rprice /mnt/home/rprice/bark/bark.sh 12
   ...
   0  11,23  * * *  rprice /mnt/home/rprice/bark/bark.sh 11

In the bark.sh script, the sound is produced by sox command

   /usr/bin/play -q hour12.au

I have now migrated to Debian stretch but would still like to hear Biff barking 
the hours.  The cron job works well as long as VLC is not running.  But while 
VLC runs, the cron job waits.  When VLC has finished, I hear the barking.  Is 
there some way of having the barking while VLC plays?


I can see nothing in VLC configuration file ~rprice/.config/vlc/vlcrc which 
prevents others from accessing the sound card at the same time.


Roger




Re: Weird shell script behavior in a cron job

2017-09-01 Thread David Margerison
On 31 August 2017 at 04:32, James H. H. Lampert
 wrote:
>
> I added a line to echo $SHELL to my debugging log file, and
> that was it: if I ran it from cron, $SHELL was /bin/sh; if I ran it from a
> command line, $SHELL was /bin/bash.

Be careful to correctly understand the purpose of the SHELL environment
variable. It does *not* report the value of the running shell. Here is a
demonstration, using an interactive terminal on jessie, where the shell 'dash'
is told to output the value of SHELL:

$ dash -c 'echo "shell is $SHELL"'
shell is /bin/bash

The SHELL variable inherited by child process of an interactive login is set by
login (see 'man 1 login') to the value read from /etc/passwd. You can redefine
it if you wish. My login shell is /bin/bash, so I see the above output.

The cron SHELL variable is set by cron, see 'man 5 crontab'.

The purpose of the SHELL variable is to offer information to child processes
which executable you want them to run whenever they create a child shell,
if they are polite enough to obey it.

What you saw is that cron sets SHELL to /bin/sh, and your user login
sets it to /bin/bash.

My example above shows that SHELL does not confirm which actual shell
is running, although in general they will be the same unless something else
has caused them to be different, which can easily happen as shown by the
example.



Re: Weird shell script behavior in a cron job

2017-08-31 Thread James H. H. Lampert

On 8/31/17, 5:16 AM, Reco wrote:

$ bash -c 'cd foo; echo $?'
bash: line 0: cd: foo: No such file or directory
1

To this:

$ dash -c 'cd foo; echo $?'
dash: 1: cd: can't cd to foo
2


Aha! That's what it was! Thanks!

At any rate, changing the test script's utterly nonspecific shebang 
(that, I gather, essentially just said "this is a script, but you're on 
your own to figure out what interpreter it wants"), and the backup 
script's "#!/bin/sh" shebang both to a "#!/bin/bash" shebang solved the 
problem quite nicely.


And late last night (actually, early this morning), after I'd left the 
box with Gnome signed off and ExternalHD very deliberately unmounted, 
the backup script worked perfectly.


--
JHHL



Re: Weird shell script behavior in a cron job

2017-08-31 Thread Reco
Hi.

On Thu, Aug 31, 2017 at 08:03:51AM -0400, Greg Wooledge wrote:
> On Thu, Aug 31, 2017 at 06:52:28AM +0100, Jonathan de Boyne Pollard wrote:
> > James H. H. Lampert:
> > 
> > > Could it be that |cron| is running it an entirely different shell, that
> > > doesn't understand the |if| statement?
> > > 
> > Despite what others have said, the answer to this question is no.  Whilst
> > you /are/ running two different shells, the problem is not the |if|
> > statement.
> 
> The if statement that he actually *showed* was POSIX-compatible, yes.
> But he later said that changing the shebang fixed his problem, so
> there was some other part of his script that was bash-specific.

No, actually it was quoted part that was bash-specific. Problematic
condition was testing for return code 1 after cd ( '[ "$?" = "1" ]' ).

Compare this:

$ bash -c 'cd foo; echo $?'
bash: line 0: cd: foo: No such file or directory
1

To this:

$ dash -c 'cd foo; echo $?'
dash: 1: cd: can't cd to foo
2

Reco



Re: Weird shell script behavior in a cron job

2017-08-31 Thread Greg Wooledge
On Thu, Aug 31, 2017 at 06:52:28AM +0100, Jonathan de Boyne Pollard wrote:
> James H. H. Lampert:
> 
> > Could it be that |cron| is running it an entirely different shell, that
> > doesn't understand the |if| statement?
> > 
> Despite what others have said, the answer to this question is no.  Whilst
> you /are/ running two different shells, the problem is not the |if|
> statement.

The if statement that he actually *showed* was POSIX-compatible, yes.
But he later said that changing the shebang fixed his problem, so
there was some other part of his script that was bash-specific.



Re: Weird shell script behavior in a cron job

2017-08-31 Thread Jonathan de Boyne Pollard

James H. H. Lampert:

Could it be that |cron| is running it an entirely different shell, 
that doesn't understand the |if| statement?


Despite what others have said, the answer to this question is no.  
Whilst you /are/ running two different shells, the problem is not the 
|if| statement.  Both of those shells understand that |if| statement.  
The difference between the shells involves the fact that you have 
assumed a particular exit status for the |cd| command for non-existent 
directories.  That's the exit status that the |cd| command results in, 
in one of your shells.  But it is not the exit status that results in 
the other.


Ironically, you are using the |[| command /anyway/, and that command has 
a direct method, its |-d| operator, for testing for the non-existence of 
a directory.  So you are going around the houses a bit in order to 
achieve what you could be achieving directly, and portably (without 
assumptions about exit statuses), with the |[| command itself.




Re: Weird shell script behavior in a cron job

2017-08-30 Thread Greg Wooledge
On Wed, Aug 30, 2017 at 09:32:37PM +0300, Reco wrote:
> > > #!
> 
> A curious shebang.

> > Why would the behavior be any different? Could it be that cron is running it
> > an entirely different shell, that doesn't understand the "if" statement?
> 
> Presumably your script runs via /bin/bash in interactive mode, and via
> /bin/sh (should be /bin/dash) if run by cron.

Yes, exactly this.  The shebang is malformed, so the kernel cannot
execute the script directly.  When a shell tries to run this script,
the kernel will return ENOEXEC.  The shell sees this, and forks a
child of itself to be the interpreter.

>From an interactive bash shell, therefore, your script would be run by
bash.

>From crontab, each line is executed by /bin/sh, so your script would
end up being run by another instance of /bin/sh.

This is why it's vitally important to put the correct shebnang on every
script you run.  If you don't, you either get direct failures if you're
lucky, or indeterminate behavior if you are not.



Re: Weird shell script behavior in a cron job

2017-08-30 Thread David Wright
On Wed 30 Aug 2017 at 11:07:36 (-0700), James H. H. Lampert wrote:
> Can somebody explain this:
> 
> My backup script WILL detect that ExternalHD is not mounted, and
> attempt to mount it, if I run it manually.
> 
> But it WON'T do that if it runs in a cron job.
> 
> I've isolated the relevant code into its own script, added debugging
> output, and set it up to run every minute. Here's the test script:
> >#!
> >date >> ~/test.txt
> >pwd >> ~/test.txt
> >cd /media/ExternalHD/Backups
> >if [ "$?" = "1" ]; then
> >  echo "mounting" >> ~/test.txt
> >  mount /media/ExternalHD >> ~/test.txt
> >  cd /media/ExternalHD/Backups
> >fi
> >pwd >> ~/test.txt
> 
> Here is what I get when the cron job trips, and ExternalHD is not mounted:
> >Wed Aug 30 10:49:01 PDT 2017
> >/root
> >/root
> >Wed Aug 30 10:50:01 PDT 2017
> >/root
> >/root
> . . .
> >Wed Aug 30 10:55:01 PDT 2017
> >/root
> >/root
> 
> and here is what I get when I run the script from a command line:
> >Wed Aug 30 10:55:07 PDT 2017
> >/root
> >mounting
> >/media/ExternalHD/Backups
> 
> Why would the behavior be any different? Could it be that cron is
> running it an entirely different shell, that doesn't understand the
> "if" statement? Here's the crontab line:
> >* * * * *   ~/test.sh

Yes,   man 5 crontab   documents exactly that.

Cheers,
David.



Re: Weird shell script behavior in a cron job

2017-08-30 Thread James H. H. Lampert
A few minutes ago, with respect to my backup script attempting to mount 
ExternalHD if run from a command line, but not from cron, I wrote:

Why would the behavior be any different? Could it be that cron is
running it an entirely different shell, that doesn't understand the "if"
statement?


That was it. I added a line to echo $SHELL to my debugging log file, and 
that was it: if I ran it from cron, $SHELL was /bin/sh; if I ran it from 
a command line, $SHELL was /bin/bash.


Changing the shebang from
> #!
to
> #! /bin/bash

did the trick, and when I looked back at the original script, I found a 
shebang of

> #! /bin/sh

which I also changed. High hopes for finding successful test results 
tomorrow morning.


--
JHHL



Re: Weird shell script behavior in a cron job

2017-08-30 Thread Reco
Hi.

On Wed, Aug 30, 2017 at 11:07:36AM -0700, James H. H. Lampert wrote:
> Can somebody explain this:
> 
> My backup script WILL detect that ExternalHD is not mounted, and attempt to
> mount it, if I run it manually.
> 
> But it WON'T do that if it runs in a cron job.
> 
> I've isolated the relevant code into its own script, added debugging output,
> and set it up to run every minute. Here's the test script:
> > #!

A curious shebang.


> > date >> ~/test.txt
> > pwd >> ~/test.txt
> > cd /media/ExternalHD/Backups
> > if [ "$?" = "1" ]; then
> >   echo "mounting" >> ~/test.txt
> >   mount /media/ExternalHD >> ~/test.txt
> >   cd /media/ExternalHD/Backups
> > fi
> > pwd >> ~/test.txt

What about this approach?

date >> ~/test.txt
pwd >> ~/test.txt
/bin/mountpoint -q /media/ExternalHD/Backups || \
mount /media/ExternalHD && \
cd /media/ExternalHD/Backups
pwd >> ~/test.txt


> Why would the behavior be any different? Could it be that cron is running it
> an entirely different shell, that doesn't understand the "if" statement?

Presumably your script runs via /bin/bash in interactive mode, and via
/bin/sh (should be /bin/dash) if run by cron.

Reco



Weird shell script behavior in a cron job

2017-08-30 Thread James H. H. Lampert

Can somebody explain this:

My backup script WILL detect that ExternalHD is not mounted, and attempt 
to mount it, if I run it manually.


But it WON'T do that if it runs in a cron job.

I've isolated the relevant code into its own script, added debugging 
output, and set it up to run every minute. Here's the test script:

#!
date >> ~/test.txt
pwd >> ~/test.txt
cd /media/ExternalHD/Backups
if [ "$?" = "1" ]; then
  echo "mounting" >> ~/test.txt
  mount /media/ExternalHD >> ~/test.txt
  cd /media/ExternalHD/Backups
fi
pwd >> ~/test.txt


Here is what I get when the cron job trips, and ExternalHD is not mounted:

Wed Aug 30 10:49:01 PDT 2017
/root
/root
Wed Aug 30 10:50:01 PDT 2017
/root
/root

. . .

Wed Aug 30 10:55:01 PDT 2017
/root
/root


and here is what I get when I run the script from a command line:

Wed Aug 30 10:55:07 PDT 2017
/root
mounting
/media/ExternalHD/Backups


Why would the behavior be any different? Could it be that cron is 
running it an entirely different shell, that doesn't understand the "if" 
statement? Here's the crontab line:

* * * * *   ~/test.sh


--
JHHL



Re: cron job not executing

2012-05-06 Thread Camaleón
On Sat, 05 May 2012 18:26:30 -0400, Tony Baldwin wrote:

 I've got a little cron job,
 just trying to fire off a script (see http://tonyb.us/mattbot ) and it's
 not firing.
 
 I have other jobs on the same crontab that do. When I run the script
 manually, it runs.

(...)

Here is a good collection of the common reasons why a cron job does not 
engage:

http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work

P.S. I vote for the missing empty line :-P

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jo5n1s$kir$4...@dough.gmane.org



Re: cron job not executing

2012-05-06 Thread Martin McCormick
=?iso-8859-1?q?Camale=F3n?= writes:
 Here is a good collection of the common reasons why a cron job does not
 engage:
 
 http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work

One thing you can do is to set an at job to run your
script once. Go to the directory you want to run the job from
and type something like

at 12:00 may 31

after hitting enter and getting the at prompt, type the name of
the script. Hit Enter again and Control-D to save the job and
take note of the job number.

Now do at -c job#,  whatever that is, and pipe it to a
file.

This will be a script in and of itself and contain the
environment you had when you ran the at command. Save your path
and any other important variables and junk the rest. Now edit
your script and put the environment data at the top, editing as
appropriate.

You can now junk the at job with atrm job#.

I have done this before when cron jobs ran manually but didn't
run under cron and at least the environment reminds you what it
should have to work correctly.

Martin McCormick


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201205061745.q46hjxpx023...@x.it.okstate.edu



Re: cron job not executing

2012-05-06 Thread Tony Baldwin
On Sun, May 06, 2012 at 02:07:08AM +0300, Adrian Fita wrote:
 On 06/05/12 01:26, Tony Baldwin wrote:
  I've got a little cron job, 
  just trying to fire off a script (see http://tonyb.us/mattbot )
  and it's not firing.
 
 [...]
 
  Probably something really obvious I'm overlooking, but the more I look,
  the less I see why there's a problem.
  
  any and all assistance appreciated in advance
 
 Have you tried looking at the cron log to check and see if the script is
 firing? You might have to enable the cron log if there is no log from
 cron (check here: [1]).

I couldn't find a cron log per se, but figured out stuff from cron
is logged in syslog.

I also piped output from my script to a log, but it didn't reveal
anything until cron started firing it off.
Now it's working.

I have not determined what the initial problem was.
I think restarting cron, perhaps, is what solved the issue, however.

thanks,
tony
-- 
http://www.tonybaldwin.me
all tony, all the time!
3F330C6E


signature.asc
Description: Digital signature


Re: cron job not executing

2012-05-06 Thread Tony Baldwin
On Sun, May 06, 2012 at 11:24:44AM +, Camaleón wrote:
 On Sat, 05 May 2012 18:26:30 -0400, Tony Baldwin wrote:
 
  I've got a little cron job,
  just trying to fire off a script (see http://tonyb.us/mattbot ) and it's
  not firing.
  
  I have other jobs on the same crontab that do. When I run the script
  manually, it runs.
 
 (...)
 
 Here is a good collection of the common reasons why a cron job does not 
 engage:
 
 http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work
 
 P.S. I vote for the missing empty line :-P

Ha! I think that WAS it!
Always something so simple and easily overlooked...

tony
-- 
http://www.tonybaldwin.me
all tony, all the time!
3F330C6E


signature.asc
Description: Digital signature


cron job not executing

2012-05-05 Thread Tony Baldwin
I've got a little cron job, 
just trying to fire off a script (see http://tonyb.us/mattbot )
and it's not firing.

I have other jobs on the same crontab that do.
When I run the script manually, it runs.

I've tried, in my user crontab
0 * * * * /path/to/script
or
@hourly /path/to/script
or
0 * * * * cd /path/to/ ./script
and even stuck a script in 
/etc/cron.hourl with
#!/bin/bash
cd /path/to/
./script

and none of these has made the script run.

I have another in my user script
05 2 * * * /path/to/another/script
and it works every morning at 2:05am, like clockwork,
so I can't figure why this new one isn't working.
Permissions on both scripts are the same, etc.

Now, I've also added a script to /usr/local/bin 
with the cd /path/to
./script

and tried to tell cron to run that script with
0 * * * /usr/local/bin/script
I'll have to wait another 35 min., now, to see if that works,
but I can't figure out for the life of me why none of the other methods
worked.

??

Probably something really obvious I'm overlooking, but the more I look,
the less I see why there's a problem.

any and all assistance appreciated in advance

./tony
-- 
http://www.tonybaldwin.me
all tony, all the time!
3F330C6E


signature.asc
Description: Digital signature


Re: cron job not executing

2012-05-05 Thread Adrian Fita
On 06/05/12 01:26, Tony Baldwin wrote:
 I've got a little cron job, 
 just trying to fire off a script (see http://tonyb.us/mattbot )
 and it's not firing.

[...]

 Probably something really obvious I'm overlooking, but the more I look,
 the less I see why there's a problem.
 
 any and all assistance appreciated in advance

Have you tried looking at the cron log to check and see if the script is
firing? You might have to enable the cron log if there is no log from
cron (check here: [1]).

  1. http://happy-coding.com/enable-crontab-logging-in-debian-linux/

-- 
Fita Adrian


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4fa5b29c.8050...@gmail.com



Re: cron job not executing

2012-05-05 Thread Patrick Wiseman
On Sat, May 5, 2012 at 6:26 PM, Tony Baldwin t...@tonybaldwin.org wrote:
 I've got a little cron job,
 just trying to fire off a script (see http://tonyb.us/mattbot )
 and it's not firing.

 I have other jobs on the same crontab that do.
 When I run the script manually, it runs.

[...]

 Probably something really obvious I'm overlooking, but the more I look,
 the less I see why there's a problem.

In my experience with cron jobs it's either permissions or path.
Permissions you said are OK, so I'd put a PATH statement in your
script (I notice it has none), which includes a path to your script
and any programs it calls. Cron jobs operate with a very lean
environment, so the fact it works when you run it from the command
line is no guarantee it will run as a cron job.

Patrick


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAJVvKsPPwiydV=tw0h_qnh+8zac8mgbybqkd09_uv+wc1rx...@mail.gmail.com



How often will this cron job execute

2012-03-08 Thread T o n g
Hi,

I've got the following entry in my cron job:

1 1 1 */2 * me my-this-job

How often will it execute?

Checking the log, I notice that it run on Jan 1 and Mar 1. That's really 
not something that I've been expecting for. I have another cron job fired 
at Feb 1, so no doubt that my cron was working on Feb 1 and my my-this-job
didn't get fired up then.

Is there anything that I don't know? 

Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jjc14t$dgi$1...@dough.gmane.org



Re: How often will this cron job execute

2012-03-08 Thread Tom H
On Thu, Mar 8, 2012 at 11:32 PM, T o n g mlist4sunt...@yahoo.com wrote:

 I've got the following entry in my cron job:

 1 1 1 */2 * me my-this-job

 How often will it execute?

 Checking the log, I notice that it run on Jan 1 and Mar 1. That's really
 not something that I've been expecting for. I have another cron job fired
 at Feb 1, so no doubt that my cron was working on Feb 1 and my my-this-job
 didn't get fired up then.

*/2 means every other month.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAOdo=SyCqNyezCE=8AEpFg6N_=4PVvSOqQCnb=599wps8bz...@mail.gmail.com



Re: cron job mergelog failure

2012-02-09 Thread Tony Baldwin
On Wed, Feb 08, 2012 at 01:59:27PM -0500, Tony Baldwin wrote:
 On Wed, Feb 08, 2012 at 08:35:44AM -0800, Noah Meyerhans wrote:
  On Wed, Feb 08, 2012 at 10:57:54AM -0500, Tony Baldwin wrote:
 0 1 * * * mergelog /var/log/apache2/access.log [...]
 Every day I get an e-mail telling me this failed.

 Now, I can go in and to this manually, 
 Why can't cron do it without my intervention?


What reason does the email give for the failure?
Chris
   
   
   mv: cannot stat `/var/log/apache2/MY.log': No such file or directory
   Clearly not merging logs and creating the MY.log file.
   I will try with the fully path and see happens tonight.
  
  Your first cron job:
  0 1 * * * mergelog /var/log/apache2/access.log 
  /var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log  MY.log
  
  This does not run with /var/log/apache2/ as $PWD, so MY.log won't be
  created in that directory.  Try being explicit about the path to MY.log,
  e.g. /var/log/apache2/MY.log
  
  noah
  
 
 Aha!
 I'm guessing this is precisely the (rather so obvious it hid in plain
 site) problem.
 
 (senility...it's my only excuse...I turned 30 for the 13th time on
 Monday)
 

Looks like it is now working as it should.

RESOLVED!

thanks,
tony
-- 
http://www.tonybaldwin.me
all tony, all the time!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120209125723.ga11...@deathstar.hsd1.ct.comcast.net



Re: cron job mergelog failure

2012-02-08 Thread Arif Hossain
On Wed, 2012-02-08 at 01:27 -0500, Tony Baldwin wrote:
 I have the following in my root crontab on my webserver:
 
 0 1 * * * mergelog /var/log/apache2/access.log
 /var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log 
 MY.log
   4 2 1 * * * mv /var/log/apache2/MY.log /var/log/apache2/my.log
 5 5 1 * * * webalizer
 
 Every day I get an e-mail telling me this failed.
 
 Now, I can go in and to this manually, 
 mergelog my.log access.log other_vhosts_access.log  MY.log
 # to merge the existing merged log with the new logs
 the 
 mv MY.log my.log
 to move the newly merged log to my.log (which webalizer is configured to
 read)
 run webalizer
 profit.
 
 Why can't cron do it without my intervention?
 
 ./tony
 -- 
 http://www.tonybaldwin.me
 all tony, all the time!
 
 

May be its because of $PATH inside cron. It will better if you use full
path of mergelog.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/blu0-smtp208fd6246dad94e84f6692ae...@phx.gbl



Re: cron job mergelog failure

2012-02-08 Thread Chris Davies
Tony Baldwin t...@tonybaldwin.org wrote:
 0 1 * * * mergelog /var/log/apache2/access.log [...]
 Every day I get an e-mail telling me this failed.

 Now, I can go in and to this manually, 
 Why can't cron do it without my intervention?


What reason does the email give for the failure?
Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/88r909x12j@news.roaima.co.uk



Re: cron job mergelog failure

2012-02-08 Thread Tony Baldwin
On Wed, Feb 08, 2012 at 09:18:32AM +, Chris Davies wrote:
 Tony Baldwin t...@tonybaldwin.org wrote:
  0 1 * * * mergelog /var/log/apache2/access.log [...]
  Every day I get an e-mail telling me this failed.
 
  Now, I can go in and to this manually, 
  Why can't cron do it without my intervention?
 
 
 What reason does the email give for the failure?
 Chris


mv: cannot stat `/var/log/apache2/MY.log': No such file or directory
Clearly not merging logs and creating the MY.log file.
I will try with the fully path and see happens tonight.

./tony
-- 
http://www.tonybaldwin.me
all tony, all the time!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120208155753.ga17...@deathstar.hsd1.ct.comcast.net



Re: cron job mergelog failure

2012-02-08 Thread Noah Meyerhans
On Wed, Feb 08, 2012 at 10:57:54AM -0500, Tony Baldwin wrote:
   0 1 * * * mergelog /var/log/apache2/access.log [...]
   Every day I get an e-mail telling me this failed.
  
   Now, I can go in and to this manually, 
   Why can't cron do it without my intervention?
  
  
  What reason does the email give for the failure?
  Chris
 
 
 mv: cannot stat `/var/log/apache2/MY.log': No such file or directory
 Clearly not merging logs and creating the MY.log file.
 I will try with the fully path and see happens tonight.

Your first cron job:
0 1 * * * mergelog /var/log/apache2/access.log 
/var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log  MY.log

This does not run with /var/log/apache2/ as $PWD, so MY.log won't be
created in that directory.  Try being explicit about the path to MY.log,
e.g. /var/log/apache2/MY.log

noah



signature.asc
Description: Digital signature


Re: cron job mergelog failure

2012-02-08 Thread Tony Baldwin
On Wed, Feb 08, 2012 at 08:35:44AM -0800, Noah Meyerhans wrote:
 On Wed, Feb 08, 2012 at 10:57:54AM -0500, Tony Baldwin wrote:
0 1 * * * mergelog /var/log/apache2/access.log [...]
Every day I get an e-mail telling me this failed.
   
Now, I can go in and to this manually, 
Why can't cron do it without my intervention?
   
   
   What reason does the email give for the failure?
   Chris
  
  
  mv: cannot stat `/var/log/apache2/MY.log': No such file or directory
  Clearly not merging logs and creating the MY.log file.
  I will try with the fully path and see happens tonight.
 
 Your first cron job:
 0 1 * * * mergelog /var/log/apache2/access.log 
 /var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log  MY.log
 
 This does not run with /var/log/apache2/ as $PWD, so MY.log won't be
 created in that directory.  Try being explicit about the path to MY.log,
 e.g. /var/log/apache2/MY.log
 
 noah
 

Aha!
I'm guessing this is precisely the (rather so obvious it hid in plain
site) problem.

(senility...it's my only excuse...I turned 30 for the 13th time on
Monday)

Thanks!

./tony
-- 
http://www.tonybaldwin.me
all tony, all the time!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120208185926.gb22...@deathstar.hsd1.ct.comcast.net



cron job mergelog failure

2012-02-07 Thread Tony Baldwin
I have the following in my root crontab on my webserver:

0 1 * * * mergelog /var/log/apache2/access.log
/var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log 
MY.log
  4 2 1 * * * mv /var/log/apache2/MY.log /var/log/apache2/my.log
5 5 1 * * * webalizer

Every day I get an e-mail telling me this failed.

Now, I can go in and to this manually, 
mergelog my.log access.log other_vhosts_access.log  MY.log
# to merge the existing merged log with the new logs
the 
mv MY.log my.log
to move the newly merged log to my.log (which webalizer is configured to
read)
run webalizer
profit.

Why can't cron do it without my intervention?

./tony
-- 
http://www.tonybaldwin.me
all tony, all the time!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120208062744.ga8...@deathstar.hsd1.ct.comcast.net



Re: Cron job

2010-08-23 Thread Burton Samograd
Boyd Stephen Smith Jr. b...@iguanasuicide.net writes:

 Finally, while you currently make your order via phone, it may be that
 your distributor has a more easily automated method, so it may be
 worth talking to their customer support and exploring the other
 ordering options.

LOL :)

--
Burton Samograd


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/hbtyml5okh@rex.userful.ca



RE: Cron job

2010-08-22 Thread Poo Py
Thanks but how did you make the shell script? Please post contents to list. 
Thanks. 

 Date: Sat, 21 Aug 2010 00:57:22 +0400
 Subject: Re: Cron job
 From: eero.voloti...@iki.fi
 To: debiantux...@hotmail.com
 CC: debian-user@lists.debian.org
 
 2010/8/20 Poo Py debiantux...@hotmail.com:
  Hi I'm tired of fucking ordering horny goat weed every week manually so can
  someone please make a fucking cron job to do this for me? Many thanks and
  god bless your kind souls.
 
 
 crontab -e and:
 
 @weekly /path/to/order_horny_goat_weed.sh
 
 --
 Eero
 
 
 -- 
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
 Archive: 
 http://lists.debian.org/aanlktin+qkulfohiekojj3dxi1axpvy+_sfp4bhgb...@mail.gmail.com
 
  

Re: Cron job

2010-08-22 Thread Boyd Stephen Smith Jr.
TOFU corrected. 

This mailing list prefers a well-trimmed and interleaved posting style.  
Trimming the quoted text being the most important part of that.

In snt121-w552ddf7cb6b8da2ac46f13dd...@phx.gbl, Poo Py wrote:
 From: b...@iguanasuicide.net
 In blu144-w236f92a17c3df9a686fb1edd...@phx.gbl, Poo Py wrote:
 Hi I'm tired of [...] ordering horny goat weed every week manually so can
 someone please make a [...] cron job to do this for me?
 
 You'll have to better describe how you order horny goat weed in order for
 me to write a script that does it for you.  Computers are very good at
 following directions, but your have to be very clear, specific, and
 incremental with all your directions.

I order by phone thanks.

I think you misunderstand the purpose of this list.  We are not a nameless 
pool of labor for you.  Rather, we are individuals, some of which, if you ask 
nicely may have some time to donate to help you accomplish tasks with or 
diagnose errors in your Debian installation.

On top of that, few of us are mind readers, so you will need to be very 
specific in telling us: what you've tried, what you know, and what results 
you've gotten so far.

I know very little about automating the process of placing a phone call and 
playing back pre-recorded responses and/or touch-tones, which is most likely 
what you would need the shell script to do.  However, you might be able to 
find more information by reading about a piece of software called Asterix; it 
handles the software side of a PBX.  I fear your cursing and terseness may 
have already put off many of the members of the mailing list that already have 
the knowledge to help with this task.

Still, a new thread, with more specific questions, no cursing, and a more 
pleasant attitude may very well get you some better answers.

Finally, while you currently make your order via phone, it may be that your 
distributor has a more easily automated method, so it may be worth talking to 
their customer support and exploring the other ordering options.
-- 
Boyd Stephen Smith Jr.   ,= ,-_-. =.
b...@iguanasuicide.net   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/\_/


signature.asc
Description: This is a digitally signed message part.


Re: Cron job

2010-08-20 Thread Eero Volotinen
2010/8/20 Poo Py debiantux...@hotmail.com:
 Hi I'm tired of fucking ordering horny goat weed every week manually so can
 someone please make a fucking cron job to do this for me? Many thanks and
 god bless your kind souls.


crontab -e and:

@weekly /path/to/order_horny_goat_weed.sh

--
Eero


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktin+qkulfohiekojj3dxi1axpvy+_sfp4bhgb...@mail.gmail.com



Re: Shutdown problem -- cron job related?

2010-05-09 Thread David Baron
 At certain times, seems Friday noontime, I am unable to shutdown the
 system. Instead of the usual scripts to killing all processes, unmounting
 everything and will now halt, goodby, I get:
 
  process running pstree (or something like that)
  shutdown aborted
 
  At this point, the system (or at least any console or UI) is dead.
 
  What it this?


 Just see which process is running pstree.
 ps -eaf | grep pstree
 You could find the parent pid of pstree (second column).
 Look at the parent of pstree, and the process started this one.
 If you go back that way, finally you will reach init, but before that you
 could find which system process started these processes.
I'll have to try it when I know the thing is running.

 As I recall, pstree is not part of basic installation.
 It was put to do some scripting, regarding found, in
 perl/python?
 My first bet would be to remove offensive cron line and
 shutdown normally. Than to do filesystem checks. Next,
 to set cron to use pstree as a regular user. I think that
 shutdown was done in some parts, aka closed network. What
 has to wait, hangs the system.
 Otherwise, there is a chance that some housekeeping pro-
 cesses are started at noon every day. You could always
 look at /etc directory and find them. Some unices have
 it in /etc/periodic/daily. It starts with #!/bin/sh.
 Another clue may be in /var/log, as a result of newsyslog.conf.

I have no /etc/periodic and no logs for pstree

I manually ran it (x11 variant) and this is what I got:
init-+-Xprt
 |-akonadi_control-+-akonadi_ical_re
 | |-8*[akonadi_kabc_re]
 | |-4*[akonadi_kcal_re]
 | |-42*[akonadi_maildir]
 | |-akonadi_maildis
 | |-akonadi_nepomuk---{akonadi_nepomu}
 | |-akonadi_vcard_r
 | |-akonadiserver-+-mysqld---74*[{mysqld}]
 | |   `-66*[{akonadiserver}]
 | `-4*[{akonadi_contro}]
 |-apmd
 |-atd
 |-avahi-daemon---avahi-daemon
 |-boinc
 |-clamd---2*[{clamd}]
 |-console-kit-dae---63*[{console-kit-da}]
 |-cron
 |-cupsd
 |-das_watchdog---{das_watchdog}
 |-3*[dbus-daemon]
 |-2*[dbus-launch]
 |-ddclient
 |-dirmngr
 |-dovecot-+-2*[dovecot-auth]
 | |-imap
 | |-3*[imap-login]
 | `-3*[pop3-login]
 |-exim4
 |-fail2ban-server---6*[{fail2ban-serve}]
 |-fetchmail
 |-2*[getty]
 |-gpm
 |-hald-+-hald-runner-+-hald-addon-inpu
 |  | `-hald-addon-stor
 |  `-{hald}
 |-in.tftpd
 |-inetd
 |-jackdbus
 |-kaccess
 |-kded4---{kded4}
 |-kdeinit4-+-kio_file
 |  |-kio_http_cache_
 |  |-kio_imap4
 |  |-klauncher
 |  |-ksmserver-+-kwin
 |  |   `-{ksmserver}
 |  |-python---python---python
 |  `-qjackctl---{qjackctl}
 |-kdm-+-Xorg
 | `-kdm---startkde-+-kwrapper4
 |  `-2*[ssh-agent]
 |-kget
 |-kglobalaccel
 |-klipper
 |-klogd
 |-kmail---{kmail}
 |-kmix
 |-knemo
 |-knotify4
 |-korgac---{korgac}
 |-krunner---{krunner}
 |-kxkb---{kxkb}
 |-nepomukserver
 |-plasma-desktop-+-ksysguardd
 |`-7*[{plasma-desktop}]
 |-portmap
 |-postmaster-+-postmaster
 |`-postmaster---postmaster
 |-preload
 |-proftpd
 |-rpc.mountd
 |-rpc.statd
 |-smartd
 |-spamd---2*[spamd]
 |-sshd
 |-svscanboot-+-readproctitle
 |`-svscan
 |-syslogd
 |-tinyproxy---11*[tinyproxy]
 |-udevd---2*[udevd]
 |-xfs
 |-xfstt
 `-yakuake-+-bash---pstree.x11
   `-{yakuake}
Press return to close

Which would basically reflect what init ran and what kde4 is doing when I did 
it. Why would this be stuck at the end?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201005091612.7.d_ba...@012.net.il



Re: Shutdown problem -- cron job related?

2010-05-09 Thread Anand Sivaram
On Sun, May 9, 2010 at 18:42, David Baron d_ba...@012.net.il wrote:

  At certain times, seems Friday noontime, I am unable to shutdown the
  system. Instead of the usual scripts to killing all processes,
 unmounting
  everything and will now halt, goodby, I get:
 
   process running pstree (or something like that)
   shutdown aborted
 
   At this point, the system (or at least any console or UI) is dead.
 
   What it this?


  Just see which process is running pstree.
  ps -eaf | grep pstree
  You could find the parent pid of pstree (second column).
  Look at the parent of pstree, and the process started this one.
  If you go back that way, finally you will reach init, but before that you
  could find which system process started these processes.
 I'll have to try it when I know the thing is running.

  As I recall, pstree is not part of basic installation.
  It was put to do some scripting, regarding found, in
  perl/python?
  My first bet would be to remove offensive cron line and
  shutdown normally. Than to do filesystem checks. Next,
  to set cron to use pstree as a regular user. I think that
  shutdown was done in some parts, aka closed network. What
  has to wait, hangs the system.
  Otherwise, there is a chance that some housekeeping pro-
  cesses are started at noon every day. You could always
  look at /etc directory and find them. Some unices have
  it in /etc/periodic/daily. It starts with #!/bin/sh.
  Another clue may be in /var/log, as a result of newsyslog.conf.

 I have no /etc/periodic and no logs for pstree

 I manually ran it (x11 variant) and this is what I got:
 init-+-Xprt
 |-akonadi_control-+-akonadi_ical_re
 | |-8*[akonadi_kabc_re]
 | |-4*[akonadi_kcal_re]
 | |-42*[akonadi_maildir]
 | |-akonadi_maildis
 | |-akonadi_nepomuk---{akonadi_nepomu}
 | |-akonadi_vcard_r
 | |-akonadiserver-+-mysqld---74*[{mysqld}]
 | |   `-66*[{akonadiserver}]
 | `-4*[{akonadi_contro}]
 |-apmd
 |-atd
 |-avahi-daemon---avahi-daemon
 |-boinc
 |-clamd---2*[{clamd}]
 |-console-kit-dae---63*[{console-kit-da}]
 |-cron
 |-cupsd
 |-das_watchdog---{das_watchdog}
 |-3*[dbus-daemon]
 |-2*[dbus-launch]
 |-ddclient
 |-dirmngr
 |-dovecot-+-2*[dovecot-auth]
 | |-imap
 | |-3*[imap-login]
 | `-3*[pop3-login]
 |-exim4
 |-fail2ban-server---6*[{fail2ban-serve}]
 |-fetchmail
 |-2*[getty]
 |-gpm
 |-hald-+-hald-runner-+-hald-addon-inpu
 |  | `-hald-addon-stor
 |  `-{hald}
 |-in.tftpd
 |-inetd
 |-jackdbus
 |-kaccess
 |-kded4---{kded4}
 |-kdeinit4-+-kio_file
 |  |-kio_http_cache_
 |  |-kio_imap4
 |  |-klauncher
 |  |-ksmserver-+-kwin
 |  |   `-{ksmserver}
 |  |-python---python---python
 |  `-qjackctl---{qjackctl}
 |-kdm-+-Xorg
 | `-kdm---startkde-+-kwrapper4
 |  `-2*[ssh-agent]
 |-kget
 |-kglobalaccel
 |-klipper
 |-klogd
 |-kmail---{kmail}
 |-kmix
 |-knemo
 |-knotify4
 |-korgac---{korgac}
 |-krunner---{krunner}
 |-kxkb---{kxkb}
 |-nepomukserver
 |-plasma-desktop-+-ksysguardd
 |`-7*[{plasma-desktop}]
 |-portmap
 |-postmaster-+-postmaster
 |`-postmaster---postmaster
 |-preload
 |-proftpd
 |-rpc.mountd
 |-rpc.statd
 |-smartd
 |-spamd---2*[spamd]
 |-sshd
 |-svscanboot-+-readproctitle
 |`-svscan
 |-syslogd
 |-tinyproxy---11*[tinyproxy]
 |-udevd---2*[udevd]
 |-xfs
 |-xfstt
 `-yakuake-+-bash---pstree.x11
   `-{yakuake}
 Press return to close

 Which would basically reflect what init ran and what kde4 is doing when I
 did
 it. Why would this be stuck at the end?


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org
 Archive: http://lists.debian.org/201005091612.7.d_ba...@012.net.il


pstree is used to list a tree of processes and it should not take much time.
I think your problem is arising from the originator of pstree.  Have you
tried using top to see any other process is taking cpu/memory?  Also take
a look
at all cron related directories and files, all files in /etc/cron.dailly,
/etc/crontab


Shutdown problem -- cron job related?

2010-05-08 Thread David Baron
At certain times, seems Friday noontime, I am unable to shutdown the system. 
Instead of the usual scripts to killing all processes, unmounting everything 
and will now halt, goodby, I get:

process running pstree (or something like that)
shutdown aborted

At this point, the system (or at least any console or UI) is dead.

What it this?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201005082252.52352.d_ba...@012.net.il



Re: Shutdown problem -- cron job related?

2010-05-08 Thread Anand Sivaram
On Sun, May 9, 2010 at 01:22, David Baron d_ba...@012.net.il wrote:

 At certain times, seems Friday noontime, I am unable to shutdown the
 system.
 Instead of the usual scripts to killing all processes, unmounting
 everything
 and will now halt, goodby, I get:

 process running pstree (or something like that)
 shutdown aborted

 At this point, the system (or at least any console or UI) is dead.

 What it this?


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org
 Archive: http://lists.debian.org/201005082252.52352.d_ba...@012.net.il


Just see which process is running pstree.
ps -eaf | grep pstree
You could find the parent pid of pstree (second column).
Look at the parent of pstree, and the process started this one.
If you go back that way, finally you will reach init, but before that you
could
find which system process started these processes.


Re: Shutdown problem -- cron job related

2010-05-08 Thread Zoran Kolic
 At certain times, seems Friday noontime, I am unable to shutdown the system. 
 Instead of the usual scripts to killing all processes, unmounting everything 
 and will now halt, goodby, I get:
 process running pstree (or something like that)
 shutdown aborted
 At this point, the system (or at least any console or UI) is dead.

As I recall, pstree is not part of basic installation.
It was put to do some scripting, regarding found, in
perl/python?
My first bet would be to remove offensive cron line and
shutdown normally. Than to do filesystem checks. Next,
to set cron to use pstree as a regular user. I think that
shutdown was done in some parts, aka closed network. What
has to wait, hangs the system.
Otherwise, there is a chance that some housekeeping pro-
cesses are started at noon every day. You could always
look at /etc directory and find them. Some unices have
it in /etc/periodic/daily. It starts with #!/bin/sh.
Another clue may be in /var/log, as a result of newsyslog.conf.
Best regards

Zoran


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100509044319.ga1...@faust.net



Re: Awstats Cron job not executing [SOLVED]

2009-10-27 Thread Alexey Salmin
Actually the log file itself doesn't need the execute permission. You
need that on directory you want to access a file from.

On Tue, Oct 27, 2009 at 10:23 AM, Kushal Koolwal
kushalkool...@hotmail.com wrote:

  20091027035155.gb5...@localhost.localdomain
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 MIME-Version: 1.0


 Ahhh I finally resolved it.

 chmod 755 -R /var/log/apache2/*

 did the trick. It's funny that it needs execute permission also. No where i=
 n the README that is mentioned. Do you think I should point this to the mai=
 ntainer through BTS?

 Kushal Koolwal

 I do blog at http://blogs.koolwal.net/

                                         =20
 _
 Windows 7: Simplify your PC. Learn more.
 http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=3DPID24727::T:=
 WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009=


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



RE: Awstats Cron job not executing [SOLVED]

2009-10-27 Thread Kushal Koolwal

 87a8dc10910270120y754f590es1019c2bbb76e8...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


You are right only the apache2 directly needs execute permission and not =
the files inside it.

#chmod 755 /var/log/apache2

works just fine.


Kushal Koolwal

I do blog at http://blogs.koolwal.net/








 =20
_
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=3DPID24727::T:=
WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3:102009=


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Awstats Cron job not executing

2009-10-26 Thread Kushal Koolwal

I am using Debian Lenny and installed awstats. Now by default the awstats 
creates a the following file:

debian:~# cat /etc/cron.d/awstats
0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f 
/etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ]  
/usr/lib/cgi-bin/awstats.pl -config=mydomain -update/dev/null

The Syslog shows that the above job is being executed but my webpage stats 
(http://mydomain/awstats/awstats.pl) do NOT get updated.

However if I change the awstats cron job to be executed by root like this:
0,10,20,30,40,50 * * * * root [ -x /usr/lib/cgi-bin/awstats.pl -a
-f /etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ]
 /usr/lib/cgi-bin/awstats.pl -config=mydomain -update
/dev/null

it gets executed every 10 mins and the webpage stats gets updated.

Based on /usr/share/doc/awstats/README.Debian, I have already given read 
permission for others user to access.log:
debian:~# ls -l /var/log/apache2/access.log
-rwr-r- 1 root adm 6671031 2009-10-26 18:00 /var/log/apache2/access.log

Not sure what am I missing?

Kushal Koolwal

I do blog at http://blogs.koolwal.net/



  
_
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3:102009

--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Awstats Cron job not executing

2009-10-26 Thread Andrew Sackville-West
On Mon, Oct 26, 2009 at 06:04:05PM -0700, Kushal Koolwal wrote:
 
 I am using Debian Lenny and installed awstats. Now by default the awstats 
 creates a the following file:
 
 debian:~# cat /etc/cron.d/awstats
 0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f 
 /etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ]  
 /usr/lib/cgi-bin/awstats.pl -config=mydomain -update/dev/null
 
 The Syslog shows that the above job is being executed but my webpage stats 
 (http://mydomain/awstats/awstats.pl) do NOT get updated.
 
 However if I change the awstats cron job to be executed by root like this:
 0,10,20,30,40,50 * * * * root [ -x /usr/lib/cgi-bin/awstats.pl -a
 -f /etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ]
  /usr/lib/cgi-bin/awstats.pl -config=mydomain -update
 /dev/null
 
 it gets executed every 10 mins and the webpage stats gets updated.
 
 Based on /usr/share/doc/awstats/README.Debian, I have already given read 
 permission for others user to access.log:
 debian:~# ls -l /var/log/apache2/access.log
 -rwr-r- 1 root adm 6671031 2009-10-26 18:00 /var/log/apache2/access.log
 
 Not sure what am I missing?

Try becoming the www-data user and trying the above
line from the command line directly? perhaps you'll get some helpful
output.

A


signature.asc
Description: Digital signature


RE: Awstats Cron job not executing

2009-10-26 Thread Kushal Koolwal

 20091027012939.ga19...@localhost.localdomain
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


 Try becoming the www-data user and trying the above

 line from the command line directly? perhaps you'll get some helpful

 output.

Actually I did intended to send the output of the above in my original mail=
 but I forgot. Here is the output:
debian:~# sudo -u www-data /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -updat=
e -config=3Dmydomain

Create/Update database for config /etc/awstats/awstats.mydomain.conf by A=
WStats version 6.7 (build 1.892)
From data in log file /var/log/apache2/access.log...
Error: Couldn't open server log file /var/log/apache2/access.log : Permis=
sion denied
Setup ('/etc/awstats/awstats.mydoamin.conf' file=2C web server or permissio=
ns) may be wrong.
Check config file=2C permissions and AWStats documentation (in 'docs' direc=
tory).
debian:~#=20

Not sure where else I need to give permission to www-data. As noted in my p=
revious mail=2C access.log already has read permission. Also I checked a=
wstats.mydomain.conf but did not find anything related to www-data and cro=
n jobs.


Kushal Koolwal

I do blog at http://blogs.koolwal.net/


 =20
_
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=3DPID24727::T:=
WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009=


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Awstats Cron job not executing

2009-10-26 Thread Andrew Sackville-West
On Mon, Oct 26, 2009 at 07:08:04PM -0700, Kushal Koolwal wrote:
 
  20091027012939.ga19...@localhost.localdomain
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 MIME-Version: 1.0
 
 
  Try becoming the www-data user and trying the above
 
  line from the command line directly? perhaps you'll get some helpful
 
  output.
 
 Actually I did intended to send the output of the above in my original mail=
  but I forgot. Here is the output:
 debian:~# sudo -u www-data /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -updat=
 e -config=3Dmydomain
 
 Create/Update database for config /etc/awstats/awstats.mydomain.conf by A=
 WStats version 6.7 (build 1.892)
 From data in log file /var/log/apache2/access.log...
 Error: Couldn't open server log file /var/log/apache2/access.log : Permis=
 sion denied

what are the permissions on /var/log/apache2? 

 Setup ('/etc/awstats/awstats.mydoamin.conf' file=2C web server or permissio=
 ns) may be wrong.
 Check config file=2C permissions and AWStats documentation (in 'docs' direc=
 tory).
 debian:~#=20
 
 Not sure where else I need to give permission to www-data. As noted in my p=
 revious mail=2C access.log already has read permission. Also I checked a=
 wstats.mydomain.conf but did not find anything related to www-data and cro=
 n jobs.

not sure what else to suggest. On my machines access.log has
permissions

-rw-r root adm

so to read the logs chmod o+r or access them from the adm group.

sorry, I've got nothing else to suggest.

A


signature.asc
Description: Digital signature


RE: Awstats Cron job not executing [SOLVED]

2009-10-26 Thread Kushal Koolwal

 20091027035155.gb5...@localhost.localdomain
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


Ahhh I finally resolved it.

chmod 755 -R /var/log/apache2/*

did the trick. It's funny that it needs execute permission also. No where i=
n the README that is mentioned. Do you think I should point this to the mai=
ntainer through BTS?

Kushal Koolwal

I do blog at http://blogs.koolwal.net/

 =20
_
Windows 7: Simplify your PC. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=3DPID24727::T:=
WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009=


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Awstats Cron job not executing

2009-10-26 Thread Alexey Salmin
On Tue, Oct 27, 2009 at 9:51 AM, Andrew Sackville-West
and...@farwestbilliards.com wrote:
 On Mon, Oct 26, 2009 at 07:08:04PM -0700, Kushal Koolwal wrote:

  20091027012939.ga19...@localhost.localdomain
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 MIME-Version: 1.0


  Try becoming the www-data user and trying the above

  line from the command line directly? perhaps you'll get some helpful

  output.

 Actually I did intended to send the output of the above in my original mail=
  but I forgot. Here is the output:
 debian:~# sudo -u www-data /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -updat=
 e -config=3Dmydomain

 Create/Update database for config /etc/awstats/awstats.mydomain.conf by A=
 WStats version 6.7 (build 1.892)
 From data in log file /var/log/apache2/access.log...
 Error: Couldn't open server log file /var/log/apache2/access.log : Permis=
 sion denied

 what are the permissions on /var/log/apache2?


Yep, try setting o+x on /var/log/apache2


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Command line question involving webmin cron job;

2009-06-18 Thread John W Foster
I have been experimenting a bit and have tried this command line for
upgrading my system;

apt-get -y update; apt-get -y upgrade 

It works fine if issued from a root terminal. However as a command line
issued as 'root' from webmin it fails with this error;
-
Ign file: apt-build Release.gpg
Ign file: apt-build/main Translation-en_US
Get:1 file: apt-build Release [89B]
Ign file: apt-build/main Packages
Hit http://http.us.debian.org lenny Release.gpg
Ign http://http.us.debian.org lenny/contrib Translation-en_US
Ign http://http.us.debian.org lenny/main Translation-en_US
Ign http://http.us.debian.org lenny/non-free Translation-en_US
Hit http://http.us.debian.org lenny Release
Get:2 http://security.debian.org lenny/updates Release.gpg [1032B]
Ign http://security.debian.org lenny/updates/main Translation-en_US
Ign http://security.debian.org lenny/updates/contrib Translation-en_US
Ign http://security.debian.org lenny/updates/non-free Translation-en_US
Get:3 http://security.debian.org lenny/updates Release [40.8kB]
Ign http://http.us.debian.org lenny/contrib Packages/DiffIndex
Ign http://http.us.debian.org lenny/main Packages/DiffIndex
Ign http://http.us.debian.org lenny/non-free Packages/DiffIndex
Hit http://http.us.debian.org lenny/contrib Packages
Hit http://http.us.debian.org lenny/main Packages
Ign http://security.debian.org lenny/updates/main Packages/DiffIndex
Hit http://http.us.debian.org lenny/non-free Packages
Ign http://security.debian.org lenny/updates/contrib Packages/DiffIndex
Ign http://security.debian.org lenny/updates/non-free Packages/DiffIndex
Get:4 http://security.debian.org lenny/updates/main Packages [124kB]
Hit http://security.debian.org lenny/updates/contrib Packages
Hit http://security.debian.org lenny/updates/non-free Packages
Hit http://mirrors.kernel.org lenny Release.gpg
Ign http://mirrors.kernel.org lenny/main Translation-en_US
Ign http://mirrors.kernel.org lenny/contrib Translation-en_US
Ign http://mirrors.kernel.org lenny/non-free Translation-en_US
Get:5 http://volatile.debian.org lenny/volatile Release.gpg [189B]
Get:6 http://www.debian-multimedia.org lenny Release.gpg [197B]
Hit http://www.debian-multimedia.org lenny/main Translation-en_US
Ign http://volatile.debian.org lenny/volatile/main Translation-en_US
Hit http://mirrors.kernel.org lenny Release
Get:7 http://www.debian-multimedia.org lenny Release [11.5kB]
Get:8 http://volatile.debian.org lenny/volatile Release [40.7kB]
Ign http://mirrors.kernel.org lenny/main Packages/DiffIndex
Ign http://mirrors.kernel.org lenny/contrib Packages/DiffIndex
Ign http://mirrors.kernel.org lenny/non-free Packages/DiffIndex
Hit http://mirrors.kernel.org lenny/main Packages
Hit http://mirrors.kernel.org lenny/contrib Packages
Hit http://mirrors.kernel.org lenny/non-free Packages
Hit http://www.debian-multimedia.org lenny/main Packages/DiffIndex
Hit http://www.backports.org lenny-backports Release.gpg
Ign http://www.backports.org lenny-backports/main Translation-en_US
Ign http://www.backports.org lenny-backports/contrib Translation-en_US
Ign http://www.backports.org lenny-backports/non-free Translation-en_US
Hit http://www.backports.org lenny-backports Release
Ign http://volatile.debian.org lenny/volatile/main Packages/DiffIndex
Get:9 http://volatile.debian.org lenny/volatile/main Packages [7084B]
Ign http://www.backports.org lenny-backports/main Packages/DiffIndex
Ign http://www.backports.org lenny-backports/contrib Packages/DiffIndex
Ign http://www.backports.org lenny-backports/non-free Packages/DiffIndex
Hit http://www.backports.org lenny-backports/main Packages
Hit http://www.backports.org lenny-backports/contrib Packages
Hit http://www.backports.org lenny-backports/non-free Packages
Fetched 225kB in 3s (61.3kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2.2-common
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/3267kB of archives.
After this operation, 0B of additional disk space will be used.
dpkg: `ldconfig' not found on PATH.
dpkg: `start-stop-daemon' not found on PATH.
dpkg: `install-info' not found on PATH.
dpkg: `update-rc.d' not found on PATH.
dpkg: 4 expected program(s) not found on PATH.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin
and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)

Any ideas why?
Thanks!

-- 
John Foster


-- 
To UNSUBSCRIBE, email to 

Re: Command line question involving webmin cron job;

2009-06-18 Thread Osamu Aoki
On Thu, Jun 18, 2009 at 10:24:31AM -0500, John W Foster wrote:
 I have been experimenting a bit and have tried this command line for
 upgrading my system;
 
 apt-get -y update; apt-get -y upgrade 
 
 It works fine if issued from a root terminal. However as a command line
 issued as 'root' from webmin it fails with this error;

I do not use webmin but What is the $HOME and $USER under such
environment.

As I see output...

 After this operation, 0B of additional disk space will be used.
 dpkg: `ldconfig' not found on PATH.
 dpkg: `start-stop-daemon' not found on PATH.
 dpkg: `install-info' not found on PATH.
 dpkg: `update-rc.d' not found on PATH.
 dpkg: 4 expected program(s) not found on PATH.
 NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin
 and /sbin.
 E: Sub-process /usr/bin/dpkg returned an error code (2)
 ---

I see.  Under webmin, $PATH variable is not set as usual shell
environment.  You may wish to set webmin to set several importanrt
environment variables for root shell.

Osamu



-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: creating and logging a daily cron job

2008-10-19 Thread michael
On Fri, 2008-10-17 at 19:45 +0300, Andrei Popescu wrote:
 On Fri,17.Oct.08, 18:10:26, Emanoil Kotsev wrote:
  
   this doesn't seem to be true the job runs and produces output and
   root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
   don't get any o/p from /etc/cron.daily jobs whereas I do from all my
   crontab jobs...
  
  I think the *.sh extention is what's wrong, try removing it. just name the
  script backup. That's what I did and it suddenly worked and is working
  since 4 years ago.
  
 Actually the dot:
 
 ,[ run-parts(8) ]
 | If neither the --lsbsysinit option nor the --regex option is given then 
 | the names must consist entirely of upper and lower case
 | letters, digits, underscores, and hyphens.
 `

Okay, my shorthand description of my problem was perhaps too shorthand!
The script isn't actually backup.sh but rather a link and as far as I
can tell is okay:


[EMAIL PROTECTED]:/etc/cron.daily$ ls -lt|head
total 92
lrwxrwxrwx 1 root root   46 Oct  9 13:30 backup-rsync-hdb1_users-VERI
- /home/michael/bin/backup-rsync-hdb1_users-VERI*
-rwxr-xr-x 1 root root  314 Mar 14  2007 aptitude*
-rwxr-xr-x 1 root root  577 Mar  8  2007 chkrootkit*
-rwxr-xr-x 1 root root 1154 Mar  4  2007 ntp*
-rwxr-xr-x 1 root root 5041 Feb 26  2007 apt*
-rwxr-xr-x 1 root root  469 Feb 26  2007 sysstat*
-rwxr-xr-x 1 root root 1450 Jan 21  2007 webalizer*
-rwxr-xr-x 1 root root 3961 Jan 20  2007 exim4-base*
-rwxr-xr-x 1 root root 3283 Dec 20  2006 standard*


thanks, Michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-18 Thread Thorny
On Fri, 17 Oct 2008 19:10:01 +0200, Emanoil Kotsev wrote:

 On Fri,17.Oct.08, 18:10:26, Emanoil Kotsev wrote:
  
  this doesn't seem to be true the job runs and produces output
  and root mail is (via /etc/aliases - thanks to Doug!) sent to me but
  yet I don't get any o/p from /etc/cron.daily jobs whereas I do from
  all

Emanoil, just so you know, I agree with Andrei. Sarge is, in my opinion, a
bad choice for a production server at this point in history. I don't have
any way of knowing what you downloaded recently, I have no idea when you
last upgraded but when Lenny comes out, you should probably consider
dist-upgrade. The Sarge repository won't stay in the same location for too
long after it becomes oldstable, it will be archived.


 Do you know when lenny becomes stable?
 
 
Since I know you from other lists, I will say it this way, not trying to
be sarcastic.

Answer: The Debian Way - Lenny will be released, when it is ready. :-)

Actually, you could follow the release critical bugs and get a pretty good
idea of readiness. I'm surprised you didn't already know this but I'm also
surprised you're still running Sarge, you've not mentioned that
previously.
 http://bugs.debian.org/release-critical/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-17 Thread michael
On Tue, 2008-10-14 at 14:18 +0100, Dave Ewart wrote:
 On Tuesday, 14.10.2008 at 13:22 +0100, michael wrote:
 
  If I wish to have, say, a backup script running daily by the system (ie
  with su privileges) and to have access to any std out/err output what's
  the recommended Debian way to do so?
  
  I've tried
  a) create $HOME/bin/backup.sh script
  b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily
  
  and it appears to run each day. However, I can't find where std out/err
  is going to - there's nothing in /var/log/syslog for example.
  
  Note I don't want to receive mail for all cron jobs run by the system so
  I presume setting MAILTO in /etc/crontab is not the way forward.
 
 I think the standard output for jobs run out of cron.daily will
 typically go to root's mailbox.

this doesn't seem to be true the job runs and produces output and
root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
don't get any o/p from /etc/cron.daily jobs whereas I do from all my
crontab jobs...


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-17 Thread Emanoil Kotsev
michael wrote:

 On Tue, 2008-10-14 at 14:18 +0100, Dave Ewart wrote:
 On Tuesday, 14.10.2008 at 13:22 +0100, michael wrote:
 
  If I wish to have, say, a backup script running daily by the system (ie
  with su privileges) and to have access to any std out/err output what's
  the recommended Debian way to do so?
  
  I've tried
  a) create $HOME/bin/backup.sh script
  b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily
  
  and it appears to run each day. However, I can't find where std out/err
  is going to - there's nothing in /var/log/syslog for example.
  
  Note I don't want to receive mail for all cron jobs run by the system
  so I presume setting MAILTO in /etc/crontab is not the way forward.
 
 I think the standard output for jobs run out of cron.daily will
 typically go to root's mailbox.
 
 this doesn't seem to be true the job runs and produces output and
 root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
 don't get any o/p from /etc/cron.daily jobs whereas I do from all my
 crontab jobs...

I think the *.sh extention is what's wrong, try removing it. just name the
script backup. That's what I did and it suddenly worked and is working
since 4 years ago.
I did it on sarge, which is still the main server os for me.

regards


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-17 Thread Andrei Popescu
On Fri,17.Oct.08, 18:10:26, Emanoil Kotsev wrote:
 
  this doesn't seem to be true the job runs and produces output and
  root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
  don't get any o/p from /etc/cron.daily jobs whereas I do from all my
  crontab jobs...
 
 I think the *.sh extention is what's wrong, try removing it. just name the
 script backup. That's what I did and it suddenly worked and is working
 since 4 years ago.
 
Actually the dot:

,[ run-parts(8) ]
| If neither the --lsbsysinit option nor the --regex option is given then 
| the names must consist entirely of upper and lower case
| letters, digits, underscores, and hyphens.
`

 I did it on sarge, which is still the main server os for me.

Uh, sarge hasn't received any security updates in a while...

Regards,
Andrei
-- 
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


signature.asc
Description: Digital signature


Re: creating and logging a daily cron job

2008-10-17 Thread Emanoil Kotsev
Andrei Popescu wrote:

 On Fri,17.Oct.08, 18:10:26, Emanoil Kotsev wrote:
  
  this doesn't seem to be true the job runs and produces output and
  root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
  don't get any o/p from /etc/cron.daily jobs whereas I do from all my
  crontab jobs...
 
 I think the *.sh extention is what's wrong, try removing it. just name
 the script backup. That's what I did and it suddenly worked and is
 working since 4 years ago.
  
 Actually the dot:
 
 ,[ run-parts(8) ]
 | If neither the --lsbsysinit option nor the --regex option is given then
 | the names must consist entirely of upper and lower case
 | letters, digits, underscores, and hyphens.
 `
 

yes the dot it was implied in what I said ... but thanks for explaining, I
can not explain that good

 I did it on sarge, which is still the main server os for me.
 
 Uh, sarge hasn't received any security updates in a while...
 

Well I did update/upgrade few days ago and few packages got installed.
It's working pretty well for me so I think I'll schedule move to etch or
lenny next year.

Do you know when lenny becomes stable?

thanks and regards


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



creating and logging a daily cron job

2008-10-14 Thread michael
If I wish to have, say, a backup script running daily by the system (ie
with su privileges) and to have access to any std out/err output what's
the recommended Debian way to do so?

I've tried
a) create $HOME/bin/backup.sh script
b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily

and it appears to run each day. However, I can't find where std out/err
is going to - there's nothing in /var/log/syslog for example.

Note I don't want to receive mail for all cron jobs run by the system so
I presume setting MAILTO in /etc/crontab is not the way forward.

Many thanks, M


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-14 Thread Dave Ewart
On Tuesday, 14.10.2008 at 13:22 +0100, michael wrote:

 If I wish to have, say, a backup script running daily by the system (ie
 with su privileges) and to have access to any std out/err output what's
 the recommended Debian way to do so?
 
 I've tried
 a) create $HOME/bin/backup.sh script
 b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily
 
 and it appears to run each day. However, I can't find where std out/err
 is going to - there's nothing in /var/log/syslog for example.
 
 Note I don't want to receive mail for all cron jobs run by the system so
 I presume setting MAILTO in /etc/crontab is not the way forward.

I think the standard output for jobs run out of cron.daily will
typically go to root's mailbox.

I suggest writing/rewriting backup.sh so that it writes its output to
well-defined files, rather than relying on the behaviour of standard
output/error.

Dave.

-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
University of Oxford / Cancer Research UK
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016


signature.asc
Description: Digital signature


Re: creating and logging a daily cron job

2008-10-14 Thread michael
On Tue, 2008-10-14 at 14:18 +0100, Dave Ewart wrote:
 On Tuesday, 14.10.2008 at 13:22 +0100, michael wrote:
 
  If I wish to have, say, a backup script running daily by the system (ie
  with su privileges) and to have access to any std out/err output what's
  the recommended Debian way to do so?
  
  I've tried
  a) create $HOME/bin/backup.sh script
  b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily
  
  and it appears to run each day. However, I can't find where std out/err
  is going to - there's nothing in /var/log/syslog for example.
  
  Note I don't want to receive mail for all cron jobs run by the system so
  I presume setting MAILTO in /etc/crontab is not the way forward.
 
 I think the standard output for jobs run out of cron.daily will
 typically go to root's mailbox.

Well, root seems not to have any mail:
[EMAIL PROTECTED]:~$ sudo su -
Password:
ratty:~# whoami
root
ratty:~# echo $MAIL

ratty:~# ls /var/mail
mail  michael
ratty:~# 

 I suggest writing/rewriting backup.sh so that it writes its output to
 well-defined files, rather than relying on the behaviour of standard
 output/error.

I thought about this but presumed if there was an already set-up
mechanism for cron jobs that would be preferable. Otherwise I'd also
have to sort out how to manage my own logs for backup.sh output (not
sure would want them rotated in case I'm away for over a week, say)

ta, M


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-14 Thread Steve Kemp
On Tue Oct 14, 2008 at 14:55:15 +0100, michael wrote:

 ratty:~# ls /var/mail
 mail  michael
 ratty:~# 

  You might find that /var/mail/mail is mail for the root user.

Steve
-- 
Managed Anti-Spam Service
http://mail-scanning.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-14 Thread Dave Ewart
On Tuesday, 14.10.2008 at 14:55 +0100, michael wrote:

  I suggest writing/rewriting backup.sh so that it writes its output
  to well-defined files, rather than relying on the behaviour of
  standard output/error.
 
 I thought about this but presumed if there was an already set-up
 mechanism for cron jobs that would be preferable. Otherwise I'd also
 have to sort out how to manage my own logs for backup.sh output (not
 sure would want them rotated in case I'm away for over a week, say)

OK: why not rewrite the script to include calls to make the script use
syslog, then?  Take a look at the package 'logger'.  It works like this:

  logger -i -p syslog.info -t processname Message goes here

Dave.

-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
University of Oxford / Cancer Research UK
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016


signature.asc
Description: Digital signature


Re: creating and logging a daily cron job

2008-10-14 Thread michael
On Tue, 2008-10-14 at 14:57 +0100, Steve Kemp wrote:
 On Tue Oct 14, 2008 at 14:55:15 +0100, michael wrote:
 
  ratty:~# ls /var/mail
  mail  michael
  ratty:~# 
 
   You might find that /var/mail/mail is mail for the root user.
 
 Steve

well I did check it ;)
but it didn't have a recent timestamp/messages:

[EMAIL PROTECTED]:~$ sudo su -
Password:
ratty:~# ls -lt /var/mail/mail
-rw--- 1 mail mail 4165 Nov 11  2004 /var/mail/mail
ratty:~# mail -f /var/mail/mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
/var/mail/mail: 4 messages 4 new
N  1 [EMAIL PROTECTED] Thu Nov 11 18:32   25/923   Debconf:
Configuring ssh -- NOTE: Forwarding of X11 
 N  2 [EMAIL PROTECTED] Thu Nov 11 18:32   22/812   Debconf:
Configuring mozilla-browser -- /etc/mozilla
 N  3 [EMAIL PROTECTED] Thu Nov 11 18:32   31/1305  Debconf:
Configuring libraw1394-5 -- Check that /dev
 N  4 [EMAIL PROTECTED] Thu Nov 11 18:32   28/1125  Debconf:
Configuring libsensors3 -- libsensors3 not 
 x
ratty:~# 




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-14 Thread michael
On Tue, 2008-10-14 at 14:59 +0100, Dave Ewart wrote:
 On Tuesday, 14.10.2008 at 14:55 +0100, michael wrote:
 
   I suggest writing/rewriting backup.sh so that it writes its output
   to well-defined files, rather than relying on the behaviour of
   standard output/error.
  
  I thought about this but presumed if there was an already set-up
  mechanism for cron jobs that would be preferable. Otherwise I'd also
  have to sort out how to manage my own logs for backup.sh output (not
  sure would want them rotated in case I'm away for over a week, say)
 
 OK: why not rewrite the script to include calls to make the script use
 syslog, then?  Take a look at the package 'logger'.  It works like this:
 
   logger -i -p syslog.info -t processname Message goes here

that makes sense... I guess I could do something like


#!/bin/bash

(
### usual backup commands
) | logger -i -p syslog.info -t myBackup 


On the other hand, my previous reply says to me I don't want it in logs
but prefer it all in my mbox so could replace the pipe command with |
mail -s $0 $MyEmail ;)

thanks, M


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: creating and logging a daily cron job

2008-10-14 Thread Douglas A. Tutty
On Tue, Oct 14, 2008 at 02:55:15PM +0100, michael wrote:
 On Tue, 2008-10-14 at 14:18 +0100, Dave Ewart wrote:
  On Tuesday, 14.10.2008 at 13:22 +0100, michael wrote:
  I think the standard output for jobs run out of cron.daily will
  typically go to root's mailbox.
 
 Well, root seems not to have any mail:
 [EMAIL PROTECTED]:~$ sudo su -
 Password:
 ratty:~# whoami
 root
 ratty:~# echo $MAIL
 
 ratty:~# ls /var/mail
 mail  michael
 ratty:~# 

root's mail should be redirected in the /etc/aliases file.  Normally,
its redirected to the actual person designated to receive root's mail.  

Doug.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Question about cron job

2008-04-04 Thread Pete Kay
Hi,

Is there any utility that can help me to check the cron jobs that are
currently running under Linux?
If there is one, would you please kindly let me know?

Thanks,
Pete


Re: Question about cron job

2008-04-04 Thread omer
Le Friday 04 April 2008 11:53:48 Pete Kay, vous avez écrit :
 Hi,

 Is there any utility that can help me to check the cron jobs that are
 currently running under Linux?
 If there is one, would you please kindly let me know?


If you mean the jobs which are effectively running, any process viewer will do 
the trick (ps, pstree...). These jobs always run as a child process of the 
cron daemon. If you just want to list the scheduled jobs, use crontab -l or 
read your crontab. There are also some logs  when a job is started but I 
don't remember where (dmesg, maybe?)

-- 
Cédric Lucantis



Re: Cron job not cooperating

2007-06-07 Thread Joey Schulze
Tom Scrape wrote:
 My /etc/cron.daily contains the problem file:
 [EMAIL PROTECTED]:/etc/cron.daily# ll pflogsumm-daily.cron
 -rwxr-xr-x 1 root root 354 2007-06-06 08:49 pflogsumm-daily.cron

 Cron.log shows nothing:
 [EMAIL PROTECTED]:/var/log# cat cron.log |grep pflogsumm
 [EMAIL PROTECTED]:/var/log#

Err...

The program is not executed by cron but by run-parts (which is
executed by cron, if that matters, via /etc/crontab).

Programms in /etc/cron.{daily,weekly,monthly,hourly} are executed
regularly via run-parts.  Their name doesn't appear in the logs
since it's not cron that executes them.

For testing purpose, try executing it standalone, and maybe add
debug output (echo $(date) script started  /var/log/daily.log)
and inspect the log after the daily jobs have been run.

Regards,

Joey

-- 
GNU does not eliminate all the world's problems, only some of them.
-- The GNU Manifesto

Please always Cc to me when replying to me on the lists.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



RE: Cron job not cooperating

2007-06-07 Thread Tom Scrape
 -Original Message-
 Sent: Thursday, June 07, 2007 1:32 AM
 
 Tom Scrape wrote:
  Cron.log shows nothing:
  [EMAIL PROTECTED]:/var/log# cat cron.log |grep pflogsumm
  [EMAIL PROTECTED]:/var/log#
 
 Err...
 
 The program is not executed by cron but by run-parts (which is
 executed by cron, if that matters, via /etc/crontab).
 
 Programms in /etc/cron.{daily,weekly,monthly,hourly} are executed
 regularly via run-parts.  Their name doesn't appear in the logs
 since it's not cron that executes them.
 
 For testing purpose, try executing it standalone, and maybe add
 debug output (echo $(date) script started  /var/log/daily.log)
 and inspect the log after the daily jobs have been run.
 

Thanks for the clarification.  Hadn't realized that.

Is there a location (eg. log file) where run-parts activity can be found?  Or is
it rather just hit-and-miss debugging when trying to figure out a problem?  

For reference, the problem is fixed thanks to the previous suggestion, but I'm
curious now as to the mechanisms behind this.  Man pages enough?


--T



Re: Cron job not cooperating

2007-06-07 Thread Martin Schulze
Tom Scrape wrote:
 Is there a location (eg. log file) where run-parts activity can be found?  Or 
 is
 it rather just hit-and-miss debugging when trying to figure out a problem?  

Output is normally not generated.  It's only generated in case of an
error.  Since it is executed by cron (== /etc/crontab) it would be
sent to the account denoted by MAILTO= in said file.  If you haven't
changed anything that'll be the root account whose mail is probably
forwarded to your user account or something.

 For reference, the problem is fixed thanks to the previous suggestion, but I'm
 curious now as to the mechanisms behind this.  Man pages enough?

man cron, man crontab, man run-parts, Debian tutorial.

Regards,

Joey

-- 
GNU does not eliminate all the world's problems, only some of them.
-- The GNU Manifesto

Please always Cc to me when replying to me on the lists.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Cron job not cooperating

2007-06-06 Thread Tom Scrape
I have a cron job that's not running when I think it should
be... that is, it's not running at all.

My /etc/cron.daily contains the problem file:
[EMAIL PROTECTED]:/etc/cron.daily# ll pflogsumm-daily.cron
-rwxr-xr-x 1 root root 354 2007-06-06 08:49 pflogsumm-daily.cron

This file contains:
[EMAIL PROTECTED]:/etc/cron.daily# cat pflogsumm-daily.cron
#!/bin/bash
#
# 20061213 Cron to gather stats from mail logs and email to admin.
#  Pflogsumm can also be run by itself and/or with many
#  other options.  Check the man page.
# 20070104 Updated path after move to new server.
/usr/sbin/pflogsumm -d yesterday /var/log/mail.log 21 |mail -s `uname -n`
daily mail stats postmaster


The problem is that this job never runs.


Cron.log shows nothing:
[EMAIL PROTECTED]:/var/log# cat cron.log |grep pflogsumm
[EMAIL PROTECTED]:/var/log#


The command works as expected when copying and pasting to the command line.
Furthermore, this script worked fine on the previous FC5 machine (the only
difference being the name of the log file.

I just sent this server live a few days ago, so I've been running the script
manually until I figure it out, but I'm having no luck.  Any idea what I'm
overlooking here?  Is it a Debian peculiarity that I've not yet discovered, or
am I more generally confused?  Thanks for any direction.


--T


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Cron job not cooperating

2007-06-06 Thread Jeff D

On Wed, 6 Jun 2007, Tom Scrape wrote:


I have a cron job that's not running when I think it should
be... that is, it's not running at all.

My /etc/cron.daily contains the problem file:
[EMAIL PROTECTED]:/etc/cron.daily# ll pflogsumm-daily.cron
-rwxr-xr-x 1 root root 354 2007-06-06 08:49 pflogsumm-daily.cron

This file contains:
[EMAIL PROTECTED]:/etc/cron.daily# cat pflogsumm-daily.cron
#!/bin/bash
#
# 20061213 Cron to gather stats from mail logs and email to admin.
#  Pflogsumm can also be run by itself and/or with many
#  other options.  Check the man page.
# 20070104 Updated path after move to new server.
/usr/sbin/pflogsumm -d yesterday /var/log/mail.log 21 |mail -s `uname -n`
daily mail stats postmaster


The problem is that this job never runs.





Cron.log shows nothing:
[EMAIL PROTECTED]:/var/log# cat cron.log |grep pflogsumm
[EMAIL PROTECTED]:/var/log#


The command works as expected when copying and pasting to the command line.
Furthermore, this script worked fine on the previous FC5 machine (the only
difference being the name of the log file.

I just sent this server live a few days ago, so I've been running the script
manually until I figure it out, but I'm having no luck.  Any idea what I'm
overlooking here?  Is it a Debian peculiarity that I've not yet discovered, or
am I more generally confused?  Thanks for any direction.


--T


try renaming the file pflogsumm-daily.cron to pflogsumm-daily-cron, 
periods aren't allowed or add the --lsbsysinit to the /etc/crontab file.


from man run-parts:
If the  --lsbsysinit  option  is not given then the names must consist
entirely of upper and lower  case  letters,  digits,  underscores, and
hyphens.


hth,
Jeff

 -+-
8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Techno.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




RE: Cron job not cooperating

2007-06-06 Thread Tom Scrape
 -Original Message-
 Sent: Wednesday, June 06, 2007 10:40 AM
 
 On Wed, 6 Jun 2007, Tom Scrape wrote:
 
  I have a cron job that's not running when I think it should
  be... that is, it's not running at all.
 
  My /etc/cron.daily contains the problem file:
  [EMAIL PROTECTED]:/etc/cron.daily# ll pflogsumm-daily.cron
  -rwxr-xr-x 1 root root 354 2007-06-06 08:49 pflogsumm-daily.cron
 
  This file contains:
  [EMAIL PROTECTED]:/etc/cron.daily# cat pflogsumm-daily.cron
  #!/bin/bash
  #
  # 20061213 Cron to gather stats from mail logs and email to admin.
  #  Pflogsumm can also be run by itself and/or with many
  #  other options.  Check the man page.
  # 20070104 Updated path after move to new server.
  /usr/sbin/pflogsumm -d yesterday /var/log/mail.log 21 
 |mail -s `uname -n`
  daily mail stats postmaster
 
 
  The problem is that this job never runs.
 
 
 
  Cron.log shows nothing:
  [EMAIL PROTECTED]:/var/log# cat cron.log |grep pflogsumm
  [EMAIL PROTECTED]:/var/log#
 
 
  The command works as expected when copying and pasting to 
 the command line.
  Furthermore, this script worked fine on the previous FC5 
 machine (the only
  difference being the name of the log file.
 
  I just sent this server live a few days ago, so I've been 
 running the script
  manually until I figure it out, but I'm having no luck.  
 Any idea what I'm
  overlooking here?  Is it a Debian peculiarity that I've not 
 yet discovered, or
  am I more generally confused?  Thanks for any direction.
 
 
  --T
 
 try renaming the file pflogsumm-daily.cron to pflogsumm-daily-cron, 
 periods aren't allowed or add the --lsbsysinit to the 
 /etc/crontab file.
 
 from man run-parts:
 If the  --lsbsysinit  option  is not given then the names must consist
 entirely of upper and lower  case  letters,  digits,  underscores, and
 hyphens.
 
 

Blast!  Had to be a technicality, didn't it?  Many thanks.  That should save me
a little effort again.


--T


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: updatedb cron job never finishes

2007-05-30 Thread Jason Dunsmore

On 5/29/07, Douglas Allan Tutty [EMAIL PROTECTED] wrote:

On Tue, May 29, 2007 at 09:42:30AM -0700, Jason Dunsmore wrote:

 Whenever updatedb runs via cron, it goes to sleep and never finishes
 the job, leaving all these processes running:

 29519 ?S  0:00 /USR/SBIN/CRON
 29520 ?Ss 0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd /
  run
 29521 ?S  0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd /
  run
 29522 ?S  0:00 run-parts --report /etc/cron.daily
 29559 ?Ss 0:00 /bin/sh /etc/cron.daily/find
 29561 ?SN 0:00 /bin/sh /usr/bin/updatedb
 29569 ?SN 0:00 /bin/sh /usr/bin/updatedb
 29572 ?SN 0:00 /usr/bin/sort -z -f
 29573 ?SN 0:00 /usr/lib/locate/frcode -0
 29577 ?SN 0:00 su nobody -s /bin/sh -c /usr/bin/find /
 -ignore_readd
 29578 ?SN 0:01 /usr/bin/find / -ignore_readdir_race ( -fstype
 NFS -o

 What could be causing this?  It happens on Etch for x86 and AMD64.


What happens if you run the command in /etc/cron.daily manually as root?

As always, I'll suggest doing it with X not runing and run it from the
command line.  In this case, I'd suggest you run top in another vt and
watch things from there, especially idle% and wa% (waiting for io).



Hmm, when I run it manually, it finishes fine.  I don't think it gets
hung up every time it runs via cron.  I'm going to try using this
modification to /etc/cron.daily/find to log messages when it gets hung
up.


15c15
   cd /  nice -n ${NICE:-10} updatedb 2/dev/null
---

  cd /  nice -n ${NICE:-10} updatedb  /var/log/updatedb.log



Thanks for the help.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




updatedb cron job never finishes

2007-05-29 Thread Jason Dunsmore

Hi,

Whenever updatedb runs via cron, it goes to sleep and never finishes
the job, leaving all these processes running:

29519 ?S  0:00 /USR/SBIN/CRON
29520 ?Ss 0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd /  run
29521 ?S  0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd /  run
29522 ?S  0:00 run-parts --report /etc/cron.daily
29559 ?Ss 0:00 /bin/sh /etc/cron.daily/find
29561 ?SN 0:00 /bin/sh /usr/bin/updatedb
29569 ?SN 0:00 /bin/sh /usr/bin/updatedb
29572 ?SN 0:00 /usr/bin/sort -z -f
29573 ?SN 0:00 /usr/lib/locate/frcode -0
29577 ?SN 0:00 su nobody -s /bin/sh -c /usr/bin/find / -ignore_readd
29578 ?SN 0:01 /usr/bin/find / -ignore_readdir_race ( -fstype NFS -o

What could be causing this?  It happens on Etch for x86 and AMD64.

Jason Dunsmore


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: updatedb cron job never finishes

2007-05-29 Thread Douglas Allan Tutty
On Tue, May 29, 2007 at 09:42:30AM -0700, Jason Dunsmore wrote:
 
 Whenever updatedb runs via cron, it goes to sleep and never finishes
 the job, leaving all these processes running:
 
 29519 ?S  0:00 /USR/SBIN/CRON
 29520 ?Ss 0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd / 
  run
 29521 ?S  0:00 /bin/sh -c test -x /usr/sbin/anacron || ( cd / 
  run
 29522 ?S  0:00 run-parts --report /etc/cron.daily
 29559 ?Ss 0:00 /bin/sh /etc/cron.daily/find
 29561 ?SN 0:00 /bin/sh /usr/bin/updatedb
 29569 ?SN 0:00 /bin/sh /usr/bin/updatedb
 29572 ?SN 0:00 /usr/bin/sort -z -f
 29573 ?SN 0:00 /usr/lib/locate/frcode -0
 29577 ?SN 0:00 su nobody -s /bin/sh -c /usr/bin/find / 
 -ignore_readd
 29578 ?SN 0:01 /usr/bin/find / -ignore_readdir_race ( -fstype 
 NFS -o
 
 What could be causing this?  It happens on Etch for x86 and AMD64.
 

What happens if you run the command in /etc/cron.daily manually as root?

As always, I'll suggest doing it with X not runing and run it from the
command line.  In this case, I'd suggest you run top in another vt and
watch things from there, especially idle% and wa% (waiting for io).

Doug.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-20 Thread Liam O'Toole
On Mon, 19 Mar 2007 19:59:18 -0400
Michael Pobega [EMAIL PROTECTED] wrote:

 On Mon, Mar 19, 2007 at 10:31:07PM +, Liam O'Toole wrote:
  On Mon, 19 Mar 2007 17:37:29 -0400
  Michael Pobega [EMAIL PROTECTED] wrote:
  
   I'm trying to get ddclient to run as a cronjob [...]
   
  
  Just invoke ddclient from a script in one of the directories
  mentioned in /etc/crontab. Your script will run regardless of which
  users are logged in (or not).
  
 
 Thanks for the pointer, I think that worked out well. I set the line
 as:
 
 */10 ** * *   rootddclient (args)
 
 Is that all I'll need to do to have ddclient update my IP
 automatically every 10 minutes? (Besides the command not working of
 course, since I've tested it out already)
 
 

That will work. But an interval of 10 minutes is way too short. You
only need to run ddclient when your IP address changes or after 30
days, whichever comes sooner. In the latter case you would run it with
the '-force' option to renew your subscription with dyndns.org.

-- 

Liam


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-20 Thread Michael Pobega
On Tue, Mar 20, 2007 at 01:41:22AM -0400, Celejar wrote:
 On Mon, 19 Mar 2007 17:37:29 -0400
 Michael Pobega [EMAIL PROTECTED] wrote:
   
  I know ddclient can run as a daemon, but most of the time that daemon
  doesn't work and I end up just having to run ddclient manually myself.
  I'd just like to be able to set it as a cronjob, if that's possible.
 
 Just curious, what goes wrong when you run it as a daemon? It seems to
 work fine for me.
 

Well it usually works as a daemon, but sometimes it just doesn't
update my ip (I don't know why, but some of the time it just DOESN'T
work. Think of my cronjob as insurance).


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-20 Thread Michael Pobega
On Tue, Mar 20, 2007 at 08:11:43AM +, Liam O'Toole wrote:
 On Mon, 19 Mar 2007 19:59:18 -0400
 Michael Pobega [EMAIL PROTECTED] wrote:
 
  On Mon, Mar 19, 2007 at 10:31:07PM +, Liam O'Toole wrote:
   On Mon, 19 Mar 2007 17:37:29 -0400
   Michael Pobega [EMAIL PROTECTED] wrote:
   
I'm trying to get ddclient to run as a cronjob [...]

   
   Just invoke ddclient from a script in one of the directories
   mentioned in /etc/crontab. Your script will run regardless of which
   users are logged in (or not).
   
  
  */10 *  * * *   rootddclient (args)
  
 
 That will work. But an interval of 10 minutes is way too short. You
 only need to run ddclient when your IP address changes or after 30
 days, whichever comes sooner. In the latter case you would run it with
 the '-force' option to renew your subscription with dyndns.org.
 

I changed it to thirty minutes. The reason I need it to update so
often is because my IP changes pretty often, I'd say 3~4 times per
day. I think that's why the ddclient daemon doesn't work for me; It
may not be updating the server enough, so I  set a cronjob to take
care of that.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



ddclient cron job

2007-03-19 Thread Michael Pobega
I'm trying to get ddclient to run as a cronjob, but before I do it I
was wondering if it is not safe to do this.

I normally run under a user account (And not root), and ddclient can't
be run by anyone but the owner (It won't let you run it, even if you
have group access; /etc/ddclient.conf must only be accessible by it's
owner)

I'm just wondering, before I do anything, if it is safe to chown all
of my files to my user account? Or is there an easier alternative?

I know ddclient can run as a daemon, but most of the time that daemon
doesn't work and I end up just having to run ddclient manually myself.
I'd just like to be able to set it as a cronjob, if that's possible.

Also, if I set it as a root cronjob will that job only happen if/when
I log into root? If it works so that I don't have to be logged into
root then I could avoid a lot of hassle.

Thank you.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-19 Thread Liam O'Toole
On Mon, 19 Mar 2007 17:37:29 -0400
Michael Pobega [EMAIL PROTECTED] wrote:

 I'm trying to get ddclient to run as a cronjob, but before I do it I
 was wondering if it is not safe to do this.
 
 I normally run under a user account (And not root), and ddclient can't
 be run by anyone but the owner (It won't let you run it, even if you
 have group access; /etc/ddclient.conf must only be accessible by it's
 owner)
 
 I'm just wondering, before I do anything, if it is safe to chown all
 of my files to my user account? Or is there an easier alternative?
 
 I know ddclient can run as a daemon, but most of the time that daemon
 doesn't work and I end up just having to run ddclient manually myself.
 I'd just like to be able to set it as a cronjob, if that's possible.
 
 Also, if I set it as a root cronjob will that job only happen if/when
 I log into root? If it works so that I don't have to be logged into
 root then I could avoid a lot of hassle.
 
 Thank you.
 
 

Just invoke ddclient from a script in one of the directories mentioned
in /etc/crontab. Your script will run regardless of which users are
logged in (or not).

You can also set up your DHCP client to run ddclient when the IP
address changes. How you would do that depends on which DHCP client you
use. See the file /usr/share/doc/ddclient/README.gz for some examples.

-- 

Liam


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-19 Thread Michael Pobega
On Mon, Mar 19, 2007 at 10:31:07PM +, Liam O'Toole wrote:
 On Mon, 19 Mar 2007 17:37:29 -0400
 Michael Pobega [EMAIL PROTECTED] wrote:
 
  I'm trying to get ddclient to run as a cronjob [...]
  
 
 Just invoke ddclient from a script in one of the directories mentioned
 in /etc/crontab. Your script will run regardless of which users are
 logged in (or not).
 

Thanks for the pointer, I think that worked out well. I set the line
as:

*/10 *  * * *   rootddclient (args)

Is that all I'll need to do to have ddclient update my IP automatically
every 10 minutes? (Besides the command not working of course, since
I've tested it out already)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ddclient cron job

2007-03-19 Thread Celejar
On Mon, 19 Mar 2007 17:37:29 -0400
Michael Pobega [EMAIL PROTECTED] wrote:

[snip]

 I know ddclient can run as a daemon, but most of the time that daemon
 doesn't work and I end up just having to run ddclient manually myself.
 I'd just like to be able to set it as a cronjob, if that's possible.

Just curious, what goes wrong when you run it as a daemon? It seems to
work fine for me.

 Also, if I set it as a root cronjob will that job only happen if/when
 I log into root? If it works so that I don't have to be logged into
 root then I could avoid a lot of hassle.

Cron jobs run as long as the machine is up; it doesn't matter whether
the user who set up the job is logged on.

Celejar

-- 
ssuds.sourceforge.net - Home of Ssuds and Ssudg, a Simple Sudoku Solver
and Generator


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Running QEMU from a cron job

2007-02-23 Thread Linas Žvirblis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Nate Bargmann wrote:

 I am wanting to restart a QEMU virtual machine from a cron entry, let
 the VM do something, and then after a period of time freeze the VM
 until the next day.  After reading the docs and browsing the Web for a
 few days, I'm not so sure this is possible.

Well, I guess it is possible, but it may require some (or maybe a lot
of) programming skills. You could write an application that would
control QEMU via its monitor interface. It would then be possible to
suspend, pause, and do all sort of cool things with the VM.

A much simpler solution would be to have QEMU started by cron, and set
up the guest OS to shut down after doing something. Or you could run
QEMU in snapshot mode and simply kill it, when not needed. Or... the
possibilities are endless. What exactly do you want to achieve?

And do not forget that QEMU is mostly a GUI application, so you will
probably need to run xorg.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF3w+TztOe9mov/y4RAiOeAJwP+XAbIrMQNRhfGOcH0/Oodef4TACdG9ho
gUK+AnLR7t14mvvqp7R7ODY=
=g4e/
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Running QEMU from a cron job

2007-02-23 Thread Joshua J. Kugler
On Friday 23 February 2007 07:00, Linas Žvirblis wrote:
 And do not forget that QEMU is mostly a GUI application, so you will
 probably need to run xorg.

You can run qemu headless, with a virtual framebuffer.  Makes for a virtual 
machine you connect to via VNC to view.

-- 
Joshua Kugler   
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE
PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111



Re: Running QEMU from a cron job

2007-02-23 Thread Nate Bargmann
* Linas ??virblis [EMAIL PROTECTED] [2007 Feb 23 10:01 -0600]:

 A much simpler solution would be to have QEMU started by cron, and set
 up the guest OS to shut down after doing something. Or you could run
 QEMU in snapshot mode and simply kill it, when not needed. Or... the
 possibilities are endless. What exactly do you want to achieve?

This was the way I had originally intended to do things and I think I
figured how to get this done.  My issue was with getting qemu to shut
down.  It now appears that if I start the VM with the -no-reboot option
and then tell the guest (Slackware 10.2) to 'shutdown -r now' qemu will
exit instead.

I don't need to have any interaction between the host and the guest, I
was just missing a reliable way to shut the thing down which I think
I've figured out.

My goal in all of this is to download a CVS tree of a project I'm
working on, build a snapshot tarball, upload it to a directory, delete
the tree, and exit.  I've already got all of that working on a seperate
machine (which used to run full time) and now I'm trying to consolidate
everything onto this machine.  It can do this in the middle of the
night when I sleep.

 And do not forget that QEMU is mostly a GUI application, so you will
 probably need to run xorg.

Thanks for pointing that out.  That may be another area to work around
as well.

- Nate 

-- 
 Wireless | Amateur Radio Station N0NB  |  Successfully Microsoft
  Amateur radio exams; ham radio; Linux info @  | free since January 1998.
 http://www.qsl.net/n0nb/   |  Debian, the choice of
 My Kawasaki KZ-650 SR @| a GNU generation!
http://www.networksplus.net/n0nb/   |   http://www.debian.org


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Running QEMU from a cron job

2007-02-23 Thread Linas Žvirblis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Nate Bargmann wrote:

 And do not forget that QEMU is mostly a GUI application, so you will
 probably need to run xorg.
 
 Thanks for pointing that out.  That may be another area to work around
 as well.

As Joshua Kugler already stated, you can run QEMU headless; and there is
more than one way to do it. Apart from one already mentioned, you could
try starting QEMU in non-graphics mode, as if it had no VGA card. Same
way one would run a headless server.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF30oVztOe9mov/y4RApPKAJoCAqsfRBM3uQCnV4PYeyXM73/EVQCfcu63
1cfxrN91eG2btM9d6EOJTw8=
=Neot
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Running QEMU from a cron job

2007-02-22 Thread Nate Bargmann
I am wanting to restart a QEMU virtual machine from a cron entry, let
the VM do something, and then after a period of time freeze the VM
until the next day.  After reading the docs and browsing the Web for a
few days, I'm not so sure this is possible.

Of course, much control is available interactively, and maybe I'm just
not seeing the way this could be done as few examples exist in the user
docs.  Any tips will be appreciated.

- Nate 

-- 
 Wireless | Amateur Radio Station N0NB  |  Successfully Microsoft
  Amateur radio exams; ham radio; Linux info @  | free since January 1998.
 http://www.qsl.net/n0nb/   |  Debian, the choice of
 My Kawasaki KZ-650 SR @| a GNU generation!
http://www.networksplus.net/n0nb/   |   http://www.debian.org


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Cron-job

2006-08-02 Thread Henning Olsen
I have a php-site on which I want to send periodic mails out.I want cron to schedule that, but I don't know how to get cron tomanage that.I have my own Linux-box on which I put the linelynx 
http://blabla.com/mailscript.phpbut on my hosted webserver, there are obviously no lynx, cause it don'twork.Then what?A perl or python script?Anyone who can help me?


Re: Cron-job

2006-08-02 Thread Michael Ott
Hello Henning!

 I have a php-site on which I want to send periodic mails out.
 I want cron to schedule that, but I don't know how to get cron to
 manage that.
 I have my own Linux-box on which I put the line
 lynx http://blabla.com/mailscript.php
 but on my hosted webserver, there are obviously no lynx, cause it don't
 work.
 Then what?
 A perl or python script?
 Anyone who can help me?
Which PHP.
You can check when the last mail was send and than send a new one. And
you can put it in our website. And when anyone view this side that
script will run and do what you want.

Example (which not works)
index.php
?php

// Read last timestamp
$file_name = last_mail;
$file = fopen($file_name, r+);
$content = fread($file, filesize($filename));

$time = time();
if($file[0] = $time + $diff) {
include mailscript.php;

// Write time back to file
fseek($file, 0);
fwrite($file, $time);
}

fclose($file);

?


CU
 
  Michael  
  
-- 
,''`.   Michael Ott, e-mail: michael at zolnott dot de
   : :' :   Debian SID on Thinkpad T43: 
   `. `'http://www.zolnott.de/laptop/ibm-t43-uc34nge.html 
 `- 
Jeden Mittwoch von 21 - 24 Uhr. Zosh! auf Radio Z. 
Das Härteste, was der Musikmarkt zu bieten hat. http://www.zosh.de
Online hören: http://www.radio-z.net 



Re: Cron-job

2006-08-02 Thread Oliver Jato
 Example (which not works)
 index.php
 ?php
 
   // Read last timestamp
   $file_name = last_mail;
   $file = fopen($file_name, r+);
   $content = fread($file, filesize($filename));
 
   $time = time();
   if($file[0] = $time + $diff) {
   include mailscript.php;
 
   // Write time back to file
   fseek($file, 0);
   fwrite($file, $time);
   }
 
   fclose($file);
 
 ?

either like this, where it would be good if you could register the
script as a shutdown function, but then you'll have to be aware of the
difference in behaviour of register_shutdown_function() in differing php
versions.
or, if you're lucky, the cli version of php is installed and you can
call any php script with php -f yourscript.php.


Grüße / Regards,
Oliver
--
Earth -- mother of the most beautiful women in the universe. -- Apollo,
Who Mourns for Adonais? stardate 3468.1


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Cron-job

2006-08-02 Thread Ed Curtis

On Wed, 2 Aug 2006, Oliver Jato wrote:

  Example (which not works)
  index.php
  ?php
 
  // Read last timestamp
  $file_name = last_mail;
  $file = fopen($file_name, r+);
  $content = fread($file, filesize($filename));
 
  $time = time();
  if($file[0] = $time + $diff) {
  include mailscript.php;
 
  // Write time back to file
  fseek($file, 0);
  fwrite($file, $time);
  }
 
  fclose($file);
 
  ?

 either like this, where it would be good if you could register the
 script as a shutdown function, but then you'll have to be aware of the
 difference in behaviour of register_shutdown_function() in differing php
 versions.
 or, if you're lucky, the cli version of php is installed and you can
 call any php script with php -f yourscript.php.


 If you don't have php cli installed on your machine, you can also use
wget to call your script from cron. Check the man page for details on how
to use it. It's very simple.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Frage zu Cron-Job und dist-upgrade

2005-11-29 Thread Sven Hartge
Jochen Heller [EMAIL PROTECTED] wrote:

 man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher
 habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile,
 seit sarge schon so lange stable ist, erscheint es mir attraktiver
 dist-upgrades per cron-job durchführen zu lassen.

Schlechte Idee.

Du suchst apticron.

S°

-- 
Sven Hartge -- professioneller Unix-Geek 
Meine Gedanken im Netz: http://sven.formvision.de/blog/


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)



Re: Frage zu Cron-Job und dist-upgrade

2005-11-29 Thread Marc Haber
On Tue, 29 Nov 2005 09:48:57 +0100, Sven Hartge [EMAIL PROTECTED]
wrote:
Jochen Heller [EMAIL PROTECTED] wrote:
 man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher
 habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile,
 seit sarge schon so lange stable ist, erscheint es mir attraktiver
 dist-upgrades per cron-job durchführen zu lassen.

Schlechte Idee.

Du suchst apticron.

Was kann apticron besser als cron-apt?

Grüße
Marc

-- 
-- !! No courtesy copies, please !! -
Marc Haber |Questions are the | Mailadresse im Header
Mannheim, Germany  | Beginning of Wisdom  | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG Rightful Heir | Fon: *49 621 72739834



Re: Frage zu Cron-Job und dist-upgrade

2005-11-29 Thread Sven Hartge
Marc Haber [EMAIL PROTECTED] wrote:
 On Tue, 29 Nov 2005 09:48:57 +0100, Sven Hartge [EMAIL PROTECTED] wrote:

 Jochen Heller [EMAIL PROTECTED] wrote:
 man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher
 habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile,
 seit sarge schon so lange stable ist, erscheint es mir attraktiver
 dist-upgrades per cron-job durchführen zu lassen.

 Schlechte Idee. Du suchst apticron.

 Was kann apticron besser als cron-apt?

Mir gefiehl die Ausgabe von apticron besser als die von cron-apt.

S°

-- 
Sven Hartge -- professioneller Unix-Geek 
Meine Gedanken im Netz: http://sven.formvision.de/blog/


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)



Re: Frage zu Cron-Job und dist-upgrade

2005-11-29 Thread Marc Haber
On Tue, 29 Nov 2005 14:35:27 +0100, Sven Hartge [EMAIL PROTECTED]
wrote:
Marc Haber [EMAIL PROTECTED] wrote:
 Was kann apticron besser als cron-apt?

Mir gefiehl die Ausgabe von apticron besser als die von cron-apt.

Ich hab mir apticron eben mal angeschaut. Sieht mir alles insgesamt
erheblich weniger flexibel als cron-apt aus, nur die Ausgabe ist
hübscher. Da könnte cron-apt in der tat noch nachlegen, aber ich
brauche keine geschwätzigen freundlichen Mails.

Dass die Source-Package voller .svn-Verzeichnisse ist, macht die Sache
allerdings nicht besser.

Grüße
Marc

-- 
-- !! No courtesy copies, please !! -
Marc Haber |Questions are the | Mailadresse im Header
Mannheim, Germany  | Beginning of Wisdom  | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG Rightful Heir | Fon: *49 621 72739834



Re: Frage zu Cron-Job und dist-upgrade

2005-11-29 Thread Sven Hartge
Marc Haber [EMAIL PROTECTED] wrote:
 On Tue, 29 Nov 2005 14:35:27 +0100, Sven Hartge [EMAIL PROTECTED] wrote:
 Marc Haber [EMAIL PROTECTED] wrote:
 Was kann apticron besser als cron-apt?

 Mir gefiehl die Ausgabe von apticron besser als die von cron-apt.

 Ich hab mir apticron eben mal angeschaut. Sieht mir alles insgesamt
 erheblich weniger flexibel als cron-apt aus, nur die Ausgabe ist
 hübscher. Da könnte cron-apt in der tat noch nachlegen, aber ich
 brauche keine geschwätzigen freundlichen Mails.

Ich will es so ausdrücken: Ich brauchte kein Paket mit hoher
Flexibilität, sondern eines, das genau das tut, was es soll und nicht
durch unbedachte Erweiterungen dazu gebracht werden kann, unschöne Dinge
zu tun.

S°

-- 
Sven Hartge -- professioneller Unix-Geek 
Meine Gedanken im Netz: http://sven.formvision.de/blog/


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)



Re: Cron Job jeden Tag frü her starten

2005-11-28 Thread Michelle Konzack
Am 2005-11-24 13:29:01, schrieb Ante Damjanovic??:
 Hello,
 
 hab da ein kleines Problem mit cron.
 Ich möchte jeden Tag zu einer anderen Zeit einen Job startetn.
 Genauer gesagt an einen Tag um 18:00 am nächsten um 16:00 dann um 14:00 ...
 also jeden Tag um 2h früher, daher wiederholt sich der Zyklus auch nach 
 12 Tagen.
 Nun meine Frage ob bzw. wie ich das mit cron realisieren kann?

( 'crontab.conf' )

# start our script 2 minits after each full hour
2 * * * *   $HOME/bin/licht_ein_aus_script
__

Datei anlegen und mit 'crontab crontab.conf' aktivieren
und eine Date wie

( '~/bin/licht_ein_aus_script' )

#!/bin/bash

# Set the time difference
let TIMEDIFF=-2

# Set the first hour to execute
let FIRSTHOUR=22

# Make sure, our private ~/tmp exist
if [ ! -d ~/tmp ] ; then mkdir -p ~/tmp ; fi

# Make sure, we have this file, because
# otherwise 'cat' will return an error.
if [ -f ~/tmp/licht_ein_aus_script.execute ] ; then
# Read the hour when to execute
let EHOUR=`cat ~/tmp/licht_ein_aus_script.execute`

else
# This set the very FIRST hour of execution
# if there is no file yet.
echo -n $FIRSTHOUR ~/tmp/licht_ein_aus_script.execute
let EHOUR=$FIRSTHOUR

fi

# Get the current time and strip preceeding space
let CHOUR=`date +%k |sed s/\ //`

# Execute our script if EHOUR (execute hour)
# is the same as CHOUR (current hour)
if [ $EHOUR -eq $CHOUR ] ; then
# Set the new HOUR to execute
let NHOUR=$CHOUR$TIMEDIFF

# Set the NHOUR (new executionhour)
# to the FIRSTHOUR if NHOUR negativ
if [ $NHOUR -lt 0 ] ; then let NHOUR=$FIRSTHOUR ; fi

# save the new execution time
echo -n $NHOUR ~/tmp/licht_ein_aus_script.execute

  #
  # HIER DEIN CODE DER LICHT EIN ODER AUS SCHALTET
  #

fi


anlegen.  Getestet und funktioniert unter Woody, Sarge und Etch.

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)



Frage zu Cron-Job und dist-upgrade

2005-11-28 Thread Jochen Heller
Hallo ihr Lieben,

man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher 
habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile, 
seit sarge schon so lange stable ist, erscheint es mir attraktiver 
dist-upgrades per cron-job durchführen zu lassen.

Allerdings nehme ich an, dass ich es dann wahrscheinlich mit der Option 
-y aufrufen lassen müsste? Weil er mich ja zuerst fragen wird, ob er 
die Pakete wirklich aktualisieren soll, sehe ich das richtig?

Was mich an der Sache stört, wenn dabei auch Konfigurationsdateien 
betroffen sind, die dann entweder im aktuellen Stand bleiben oder 
überschrieben werden sollen. Weil wenn er alle fragen mit ja 
beantwortet, verliere ich ja meine alte Konfiguration, denke ich mir, 
und könnte plötzlich womöglich vor unerwarteten Verhaltensweisen der 
betreffenden Programme stehen.

Wie gesagt, entschuldigt, wenn das totaler Blödsinn ist und zerstreut 
meine Bedenken, stoßt mich lieber auf meinen Denkfehler. Denn 
eigentlich, wie gesagt, so ein Upgrade per cron-job, dass fänd ich 
schon ganz schick.

(Dabei noch die Frage, ich hab mir OpenOffice 2 als Backport gezogen? Da 
wird es doch nicht vorraussichtlich irgendwann, sofern ich bei stable 
bleibe, hakeln oder?)

Ich danke Euch schonmal und schöne Grüße

Jochen.
-- 
Jochen Heller
Berlin
Germany

E-Mail : mailto:[EMAIL PROTECTED]
Web: http://www.nordviertel.net
ICQ: 164338222

proud Debian user since 2004 and Linux-User #357813
Registered with the Linux Counter, http://counter.li.org/
PGP-Public-Key available at hkp://subkeys.pgp.net

---
System:
CPU: AMD Athlon(tm) XP 1700+
Board: K7S6A
Speicher: 512 MB (DDR333)
Grafikkarte: Radeon VE 64 MB
Festplatten: IDE 60 GB, IDE 20 GB
Kernel: 2.6.8-1-k7
XServer: XFree 4.3.0
OS: Debian Sarge 3.1
DM: KDE 3.3
---



Re: Frage zu Cron-Job und dist-upgrade

2005-11-28 Thread amd64-list
Am Montag, 28. November 2005 22:30 schrieb Jochen Heller:
 Hallo ihr Lieben,

Hi

 man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher
 habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile,
 seit sarge schon so lange stable ist, erscheint es mir attraktiver
 dist-upgrades per cron-job durchführen zu lassen.

gibts schon nimmste das packet cron-apt

 Allerdings nehme ich an, dass ich es dann wahrscheinlich mit der Option
 -y aufrufen lassen müsste? Weil er mich ja zuerst fragen wird, ob er
 die Pakete wirklich aktualisieren soll, sehe ich das richtig?

das macht das packet automatisch

 Was mich an der Sache stört, wenn dabei auch Konfigurationsdateien
 betroffen sind, die dann entweder im aktuellen Stand bleiben oder
 überschrieben werden sollen. Weil wenn er alle fragen mit ja
 beantwortet, verliere ich ja meine alte Konfiguration, denke ich mir,
 und könnte plötzlich womöglich vor unerwarteten Verhaltensweisen der
 betreffenden Programme stehen.

das läd nur die dateien runter du musst dann noch irgendwann apt-get upgrade 
eingeben daher sagst du selbst wann du die konfigs überschreibts und wann 
nicht

 Wie gesagt, entschuldigt, wenn das totaler Blödsinn ist und zerstreut
 meine Bedenken, stoßt mich lieber auf meinen Denkfehler. Denn
 eigentlich, wie gesagt, so ein Upgrade per cron-job, dass fänd ich
 schon ganz schick.

 (Dabei noch die Frage, ich hab mir OpenOffice 2 als Backport gezogen? Da
 wird es doch nicht vorraussichtlich irgendwann, sofern ich bei stable
 bleibe, hakeln oder?)

 Ich danke Euch schonmal und schöne Grüße

 Jochen.

Viele Grüße
Alex



Re: Frage zu Cron-Job und dist-upgrade

2005-11-28 Thread Hans-Georg Bork
Moin,

On Mon, Nov 28, 2005 at 10:30:55PM +0100, Jochen Heller wrote:
 Hallo ihr Lieben,
 
 man mag mir verzeihen, womöglich eine dumme Frage zu stellen. Bisher 
 habe ich dist-upgrades lieber zu Fuß durchgeführt, aber mittlerweile, 
 seit sarge schon so lange stable ist, erscheint es mir attraktiver 
 dist-upgrades per cron-job durchführen zu lassen.

dafuer gibt es cron-apt, wobei man dann einstellen kann, was exakt
passieren soll, z.B. mit neuen Konfigs ...

Gruss
-- hgb


-- 
Haeufig gestellte Fragen und Antworten (FAQ): 
http://www.de.debian.org/debian-user-german-FAQ/

Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject unsubscribe. Probleme? Mail an [EMAIL PROTECTED] (engl)



  1   2   3   >