Re: Crontab doesn't complete a script

2016-09-19 Thread Clive Menzies

Hi Thomas

The absolute path was the answer.

Your explanation has added to my limited knowledge :-)

Thanks

Clive

On 19/09/16 23:04, Thomas Schmitt wrote:

Hi,

Clive Menzies wrote:

 rsync_opts="-av --exclude-from=exclude_list --delete --delete-excluded"
 exclude_list=/root/uhuru_backup/exclude_list
rsync: failed to open exclude file exclude_list: No such file or directory (2)

The decisive difference between dialog and cron could be the
current working directory.

Try with an absolute path as parameter to --exclude-from= :

   rsync_opts="-av --exclude-from=/root/uhuru_backup/exclude_list --delete 
--delete-excluded"

Or if you want to use the variable exclude_list, set it first.
Then evaluate it by $exclude_list in the definition of variable rsync_opts:

   exclude_list=/root/uhuru_backup/exclude_list
   rsync_opts="-av --exclude-from=$exclude_list --delete --delete-excluded"

This should yield the same rsync_opts content as above line.



echo "Currently at line 17">>$log_file
/root/uhuru_backup/uhuru.daily.sh: line 17: $log_file: ambiguous redirect

Hm. To what value did you set the variable log_file ?

If i set it to "/tmp/log_file", then the echo works in dash and bash.
(We have to expect that cron uses the shell dash, whereas the dialog
  shell is probably bash.)
  
If i set it to empty text, then dash complains

   dash: 2: Syntax error: newline unexpected
bash says
   -bash: syntax error near unexpected token `newline'

A blank would do it in bash but not in dash:

   $ log_file="/tmp/log file"
   $ echo "Currently at line 17">>$log_file
   -bash: $log_file: ambiguous redirect

dash is brutal enough to really create a file "/tmp/log file".


Have a nice day :)

Thomas



--
Clive Menzies
http://freecriticalthinking.org



Re: Crontab doesn't complete a script

2016-09-19 Thread Thomas Schmitt
Hi,

Clive Menzies wrote:
> rsync_opts="-av --exclude-from=exclude_list --delete --delete-excluded"
> exclude_list=/root/uhuru_backup/exclude_list
> rsync: failed to open exclude file exclude_list: No such file or directory (2)

The decisive difference between dialog and cron could be the
current working directory. 

Try with an absolute path as parameter to --exclude-from= :

  rsync_opts="-av --exclude-from=/root/uhuru_backup/exclude_list --delete 
--delete-excluded"

Or if you want to use the variable exclude_list, set it first.
Then evaluate it by $exclude_list in the definition of variable rsync_opts:

  exclude_list=/root/uhuru_backup/exclude_list
  rsync_opts="-av --exclude-from=$exclude_list --delete --delete-excluded"

This should yield the same rsync_opts content as above line.


> echo "Currently at line 17">>$log_file
> /root/uhuru_backup/uhuru.daily.sh: line 17: $log_file: ambiguous redirect

Hm. To what value did you set the variable log_file ?

If i set it to "/tmp/log_file", then the echo works in dash and bash.
(We have to expect that cron uses the shell dash, whereas the dialog
 shell is probably bash.)
 
If i set it to empty text, then dash complains
  dash: 2: Syntax error: newline unexpected
bash says
  -bash: syntax error near unexpected token `newline'

A blank would do it in bash but not in dash:

  $ log_file="/tmp/log file"
  $ echo "Currently at line 17">>$log_file
  -bash: $log_file: ambiguous redirect

dash is brutal enough to really create a file "/tmp/log file".


Have a nice day :)

Thomas



Re: Crontab doesn't complete a script - SOLVED

2016-09-19 Thread Clive Menzies

On 19/09/16 22:10, Clive Menzies wrote:
It didn't find the exclude_list I created. I modified the script to 
point to it but clearly the syntax is not right


# Good rsync options for uhuru_backups.
rsync_opts="-av --exclude-from=exclude_list --delete 
--delete-excluded"


# exclude list location:
exclude_list=/root/uhuru_backup/exclude_list

echo "Currently at line 17">>$log_file

The log reported thus:
/root/uhuru_backup/uhuru.daily.sh: line 17: $log_file: ambiguous redirect
rsync: failed to open exclude file exclude_list: No such file or 
directory (2)

rsync error: error in file IO (code 11) at exclude.c(1179) [client=3.1.1]


D'oh! I searched around a bit and realised I'd over-complicated it.

This works :-)

# Good rsync options for uhuru_backups.
rsync_opts="-av --exclude-from=/root/uhuru_backup/exclude_list \
 --delete --delete-excluded"

Thanks Thomas, I'd still be going round in circles.

Regards

Clive

--
Clive Menzies
http://freecriticalthinking.org



Re: Crontab doesn't complete a script

2016-09-19 Thread Clive Menzies

On 19/09/16 12:31, Thomas Schmitt wrote:

The classic remedy would be to set the missing variables inside the
cronjob script.



/root/uhuru_backup/uhuru.daily.sh

Consider to put some "echo" commands into the script and direct them to
a log file:

log_file=/tmp/uhuru_daily_sh.log
...
echo "Currently at: ..." >>$log_file
...

This should give you an idea what part of the script causes the premature
end.



Thanks Thomas

I confess, I've not originated scripts before and so am on a steep 
learning curve. Your suggestion was very useful but my implementation is 
poor. It did yield useful information though.


It didn't find the exclude_list I created. I modified the script to 
point to it but clearly the syntax is not right


# Good rsync options for uhuru_backups.
rsync_opts="-av --exclude-from=exclude_list --delete --delete-excluded"

# exclude list location:
exclude_list=/root/uhuru_backup/exclude_list

echo "Currently at line 17">>$log_file

The log reported thus:
/root/uhuru_backup/uhuru.daily.sh: line 17: $log_file: ambiguous redirect
rsync: failed to open exclude file exclude_list: No such file or 
directory (2)

rsync error: error in file IO (code 11) at exclude.c(1179) [client=3.1.1]

Regards

Clive



--
Clive Menzies
http://freecriticalthinking.org



Re: Crontab doesn't complete a script

2016-09-19 Thread Thomas Schmitt
Hi,

> The daily backup script works fine when run manually as sudo but doesn't
> complete when run as a root cronjob.

The classic reason for this is difference in environment variables.
I.e. the cron job could die from a non set variable.

The classic remedy would be to set the missing variables inside the
cronjob script.


> /root/uhuru_backup/uhuru.daily.sh

Consider to put some "echo" commands into the script and direct them to
a log file:

   log_file=/tmp/uhuru_daily_sh.log
   ...
   echo "Currently at: ..." >>$log_file 
   ...

This should give you an idea what part of the script causes the premature
end.


Have a nice day :)

Thomas



Re: Crontab, Scripting and Syslog (solved)

2012-07-04 Thread Titanus Eramius
On Mon, 02 Jul 2012 15:07:46 +0100
Chris Davies  wrote:

> Titanus Eramius  wrote:
> > * 04 * * * /home/titanus/scripts/web-log >> /dev/null 2>&1
> 
> > The line runs every morning at 4, and AFAIK, the /dev/-part should
> > redirect all but errors to null.
> 
> No.
> 
> 1. This runs every minute while the hour is 4. If you want the script
> to run only a 4am, you need to specify a zero minute value too
> 
> 2. The ">> /dev/null 2>&1" tells cron to thow away not just errors but
> also all normal output. If you want to lose information written to
> stderr (typically errors), then you need "2> /dev/null"
> 
> 0 4 * * * /home/titanus/scripts/web-log 2>/dev/null
> 
> Chris
> 
> 

Thank you for the corrections, the first part works now, and
the second part will probaly be tested by some future error.

Cheers


-- 
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/20120704125006.55639...@asrock.local.aptget.dk



Re: Crontab, Scripting and Syslog (solved)

2012-07-04 Thread Titanus Eramius
On Mon, 2 Jul 2012 15:47:35 +0200
Titanus Eramius  wrote:

> snip
> 
> > # min hr dom mon dow command 
> > > *   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1
> > 
> > That is, every minute during hour 4, on every day of every month
> > (that being every day of the week), the command is run.
> > 
> > Presumably, webalizer writes its output to the same place each time,
> > so that is why you're only seeing the output of the 4:59 run.
> > 
> > Try changing your crontab to read:
> > 
> > # min hr dom mon dow command 
> >   0   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1
> > 
> > This will run at 4:00 every day, and is probably what you meant.
> > 
> Yes it is.
> I'll try and set it and return tommorrow.
> 
> Cheers
> 
> 

It works perfect. Thanks for the help :)

Cheers


-- 
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/20120704124712.6ea4b...@asrock.local.aptget.dk



Re: Crontab, Scripting and Syslog

2012-07-02 Thread Chris Davies
Titanus Eramius  wrote:
> * 04 * * * /home/titanus/scripts/web-log >> /dev/null 2>&1

> The line runs every morning at 4, and AFAIK, the /dev/-part should
> redirect all but errors to null.

No.

1. This runs every minute while the hour is 4. If you want the script
to run only a 4am, you need to specify a zero minute value too

2. The ">> /dev/null 2>&1" tells cron to thow away not just errors but
also all normal output. If you want to lose information written to stderr
(typically errors), then you need "2> /dev/null"

0 4 * * * /home/titanus/scripts/web-log 2>/dev/null

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/iim8c9x3dg@news.roaima.co.uk



Re: Crontab, Scripting and Syslog

2012-07-02 Thread Titanus Eramius
snip

> # min hr dom mon dow command 
> > *   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1
> 
> That is, every minute during hour 4, on every day of every month (that
> being every day of the week), the command is run.
> 
> Presumably, webalizer writes its output to the same place each time,
> so that is why you're only seeing the output of the 4:59 run.
> 
> Try changing your crontab to read:
> 
> # min hr dom mon dow command 
>   0   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1
> 
> This will run at 4:00 every day, and is probably what you meant.
> 
Yes it is.
I'll try and set it and return tommorrow.

Cheers


-- 
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/20120702154735.1ecfc...@asrock.local.aptget.dk



Re: Crontab, Scripting and Syslog

2012-07-02 Thread Darac Marjal
On Mon, Jul 02, 2012 at 02:51:06PM +0200, Titanus Eramius wrote:
> Hi folks
> On my webserver I've recently added a log-sorting and presentation
> program by the name of Webalizer. To make it run, I've put this line in
> the crontab (everything runs as a normal user):
> 
> * 04 * * * /home/titanus/scripts/web-log >> /dev/null 2>&1
> 
> The line runs every morning at 4, and AFAIK, the /dev/-part should
> redirect all but errors to null.
> 
> The script is really simple:
> 
[cut]
> 
> Now, my question is these lines in syslog:
> 
> titanus@aptget:~$ sudo cat /var/log/syslog | grep titanus
> Jun 11 04:00:01 aptget /USR/SBIN/CRON[1567]: (titanus) CMD
> (/home/titanus/scripts/web-log >> /dev/null 2>&1)
> Jun 11 04:01:01 aptget /USR/SBIN/CRON[1572]: (titanus) CMD
> (/home/titanus/scripts/web-log >> /dev/null 2>&1)
> 
> (One line per minut for an entire hour)
> 
> Jun 11 04:59:01 aptget /USR/SBIN/CRON[1879]: (titanus) CMD
> (/home/titanus/scripts/web-log >> /dev/null 2>&1)
> 
> What do they mean?
> As far as I can see, the result of Webalizer is made at 4, not 4:59, so
> I suspect the srcipt only runs at 4. The system is a standard Squeeze
> with nothing funny or unstable.

These lines are cron telling you what it's running. Note that your
crontab line states: 

# min hr dom mon dow command 
> *   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1

That is, every minute during hour 4, on every day of every month (that
being every day of the week), the command is run.

Presumably, webalizer writes its output to the same place each time, so
that is why you're only seeing the output of the 4:59 run.

Try changing your crontab to read:

# min hr dom mon dow command 
  0   04 *   *   *   /home/titanus/scripts/web-log >> /dev/null 2>&1

This will run at 4:00 every day, and is probably what you meant.



signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-02 Thread Jochen Spieker
Bob Proulx:
> Jochen Spieker wrote:
>> Bob Proulx:
>>>
>>> Having a literal '~/' in there works for bash.  But it doesn't work
>>> for /bin/sh linked to dash for example.
>> 
>> Works here:
… snip
> But that doesn't have anything to do with PATH.  You didn't test PATH
> containing "~/" in it.  You tested cd with "~" as an option argument.
> Those are different things.

Thanks for the convincing demonstration. I never had expected that to
make a difference.

J.
-- 
I will not admit to failure even when I know I am terribly mistaken and
have offended others.
[Agree]   [Disagree]
 


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-02 Thread Bob Proulx
Bob Proulx wrote:
> Jochen Spieker wrote:
> > Bob Proulx:
> > > Having a literal '~/' in there works for bash.  But it doesn't work
> > > for /bin/sh linked to dash for example.
> > 
> > Works here:
> > 
> > $ exec /bin/dash
> > $ cd /
> > $ pwd
> > /
> > $ cd ~
> > $ pwd
> > /home/jrschulz
> 
> But that doesn't have anything to do with PATH.  You didn't test PATH
> containing "~/" in it.  You tested cd with "~" as an option argument.
> Those are different things.
> 
> If you want to test PATH with "~/" in it then here is a test for it.
> It must be two process layers deep.  It must launch a non-bash process
> which itself launches a process.  It must not be a bash script.

Silly me!  Here is an even simpler test.

  $ mkdir -p $HOME/bin

  $ cat >$HOME/bin/pathtrial1 <<\EOF
#!/bin/sh
echo hello from pathtrial1
EOF
  $ chmod a+x $HOME/bin/pathtrial1
  $ pathtrial1
  hello from pathtrial1

That sets up the test as before.  Then simply start up dash with that PATH.

I use 'env' here as the portable way to invoke a command with a
specified environment but avoiding shell aliases and so forth and
regardless of your shell being csh or some such.

  $ env PATH='~/bin:/usr/bin:/bin' /bin/dash

Then try calling programs from $HOME/bin.  They won't be found.

  $ pathtrial1
  /bin/dash: 1: pathtrial1: not found

  $ echo $PATH
  ~/bin:/usr/bin:/bin

Bob


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-02 Thread Bob Proulx
Jochen Spieker wrote:
> Bob Proulx:
> > Having a literal '~/' in there works for bash.  But it doesn't work
> > for /bin/sh linked to dash for example.
> 
> Works here:
> 
> $ exec /bin/dash
> $ cd /
> $ pwd
> /
> $ cd ~
> $ pwd
> /home/jrschulz

But that doesn't have anything to do with PATH.  You didn't test PATH
containing "~/" in it.  You tested cd with "~" as an option argument.
Those are different things.

If you want to test PATH with "~/" in it then here is a test for it.
It must be two process layers deep.  It must launch a non-bash process
which itself launches a process.  It must not be a bash script.

  $ mkdir -p $HOME/bin

  $ cat >$HOME/bin/pathtrial1 <<\EOF
#!/bin/sh
echo hello from pathtrial1
EOF
  $ chmod a+x $HOME/bin/pathtrial1
  $ pathtrial1
  hello from pathtrial1

  $ cat >$HOME/bin/pathtrial2 <<\EOF
#!/bin/dash
echo "PATH=$PATH"
type pathtrial1
pathtrial1
EOF
  $ chmod a+x $HOME/bin/pathtrial2
  $ pathtrial2
  
PATH=/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin
  pathtrial1 is /home/bob/bin/pathtrial1
  hello from pathtrial1

That will set up a small test case.  Be sure to quote the EOF and to
check that the variables were not expanded in the test case script and
that the quotes were included properly.  Otherwise they will have been
expanded when you created the script and the test case won't have been
created properly.

Then set up your crontab with PATH holding ~/bin in it as per the
discussion.  Then call pathtrial2 in your crontab.  This following will
do it.

  SHELL=/bin/bash
  PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
  * * * * *   pathtrial2

That will show the failure.  Cron will invoke pathtrial2 and since
SHELL is set to bash then bash will find pathtrial2 in $HOME/bin okay.
That first layer of invocation will work successfully.  But the
pathtrial2 script will try to find pathtrial1 on PATH and being a
/bin/dash script it will not interpret PATH with ~/ in it and will
fail to find pathtrial1.  Cron will email the output to you.

  PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
  pathtrial1: not found
  /home/rwp/bin/pathtrial2: 4: /home/rwp/bin/pathtrial2: pathtrial1: not found

This illustrates the failure.  It isn't the first shell from cron that
fails.  That shell is bash and it works okay.  It is children
processes of bash that fail since PATH contains ~/ in it and that
expansion is a bash specific extension.

Before someone thinks this is only a problem because /bin/sh is
symlinked to dash let me show an example using perl.  Using perl has
exactly the same problem.  Set up a pathtrial3 script so that it looks
like this:

  #!/usr/bin/perl -l
  print "PATH=$ENV{'PATH'}";
  print "%%>>" . `pathtrial1` . "<<%%";
  print $?;

Run that from the command line with a normal PATH.  You will get this
output:

  $ pathtrial3
  
PATH=/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin
  %%>>hello from pathtrial1
  <<%%
  0

That looks normal given the script, right?.  Then change the crontab
to call pathtrial3 instead of pathtrial2.  By email you should be
seeing this following output:

  PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
  %%>><<%%
  -1

The pathtrial1 script couldn't be found on PATH.  It failed.  It is
this second layer of processes which will fail if they can't find
their programs on PATH.  Perl scripts and other processes that need to
locate programs on PATH will not be expanding ~/ to be the $HOME
directory since that is a bash specific extension.  Those will fail.

Bob


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-02 Thread Jochen Spieker
Bob Proulx:
> Jochen Spieker wrote:
>> 
>> You still can use
>> 
>> PATH = "~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
>> 
>> if the crontab belongs to the user 'rwp'.
> 
> Having a literal '~/' in there works for bash.  But it doesn't work
> for /bin/sh linked to dash for example.

Works here:

$ exec /bin/dash
$ cd /
$ pwd
/
$ cd ~
$ pwd
/home/jrschulz

J.
-- 
I wish I could do more to put the sparkle back into my marriage.
[Agree]   [Disagree]
 


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Bob Proulx
Bob Proulx wrote:
> Jochen Spieker wrote:
> > Bob Proulx:
> > >   # The default vixie-cron PATH is "/usr/bin:/bin", overriding the 
> > > environment.
> > >   PATH = "/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
> > 
> > You still can use
> > 
> > PATH = "~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
> > 
> > if the crontab belongs to the user 'rwp'.
> 
> Having a literal '~/' in there works for bash.  But it doesn't work
> for /bin/sh linked to dash for example.  On Debian /bin/sh defaults to
> being linked to /bin/dash, not bash, these days and in that case using
> ~/ wouldn't work.
> 
> So I guess that if ~ is used in PATH then SHELL should also be set to
> bash too.  That combination is fine.  And then of course all of the
> other fun bash'isms on the command line would also work.

Ah...  But bash doesn't clean up the path for it's own children.  So
actually that does not work.  Or works only in a restricted subset.
Because if the command executed invokes other commands those other
commands will get PATH with a ~/ in it and unless they also decode
that syntax they might fail.

So beware.  Switched it back to the full path in PATH without the ~/
in it.  And should file a bug against the crontab(5) man page about
the problem too.

Bob


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Bob Proulx
Jochen Spieker wrote:
> Bob Proulx:
> >   # The default vixie-cron PATH is "/usr/bin:/bin", overriding the 
> > environment.
> >   PATH = "/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
> 
> You still can use
> 
> PATH = "~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
> 
> if the crontab belongs to the user 'rwp'.

Having a literal '~/' in there works for bash.  But it doesn't work
for /bin/sh linked to dash for example.  On Debian /bin/sh defaults to
being linked to /bin/dash, not bash, these days and in that case using
~/ wouldn't work.

So I guess that if ~ is used in PATH then SHELL should also be set to
bash too.  That combination is fine.  And then of course all of the
other fun bash'isms on the command line would also work.

  SHELL=/bin/bash

Thanks for the hint!

Bob


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Jochen Spieker
Bob Proulx:
> 
>   # The default vixie-cron PATH is "/usr/bin:/bin", overriding the 
> environment.
>   PATH = "/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"

You still can use

PATH = "~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"

if the crontab belongs to the user 'rwp'.

J.
-- 
Nothing is as I planned it.
[Agree]   [Disagree]
 


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Bob Proulx
Jochen Spieker wrote:
> But beware that you probably need to use /full/path/to/my-script. $PATH
> is probably not what you expect.

Debian uses Vixie Cron which has some nice extensions, such as that
"*/10" you were using.  It also allows you to set PATH for all of your
cron commands.  I always have this in my crontab:

  # The default vixie-cron PATH is "/usr/bin:/bin", overriding the environment.
  PATH = "/home/rwp/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
  # Setting PATH is a vixie-cron extension.
  # Variables are not expanded.  Quotes are optional.

But note that you can't use variables such as $HOME and must set a
hard string value.

Bob


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Nicolas Bercher

Darac Marjal a écrit :

On Thu, Dec 01, 2011 at 12:19:06PM +0100, Jochen Spieker wrote:

Nicolas Bercher:

I'd like use set up a crontab rule from 6 am to midnight, and crontab(5) 
mentions:
  field  allowed values
  hour   0-23

Then, I tried something like:
  */10 6-0 * * 1-5 my-script

Using this, cron should execute my-script on 06:10, 06:20 … 23:50, 00:00, 00:10 
…
00:50. What you probably want is

*/10 6-23 * * * my-script


In addition to the above, remember that it's possible to supply lists to
cron fields. If you want to span midnight, you probably want something
like:

  */10 0,6-23 * * * my-script

Though this will run every 10 mins in the hours 00:00, 06:00, 07:00
etc. Again, probably not what you want. 6-23 will probably be best.


Thanks you two, things get clearer now because I was thinking about
numbers as boundaries instead of durations.

So you were both right, what fits my needs the best is probably
"*/10 6-23 * * 1-5"

Nicolas


--
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/4ed785d8.7070...@yahoo.fr



Re: crontab hour range 6-midnight

2011-12-01 Thread Darac Marjal
On Thu, Dec 01, 2011 at 12:19:06PM +0100, Jochen Spieker wrote:
> Nicolas Bercher:
> > 
> > I'd like use set up a crontab rule from 6 am to midnight, and crontab(5) 
> > mentions:
> >   field  allowed values
> >   hour   0-23
> > 
> > Then, I tried something like:
> >   */10 6-0 * * 1-5 my-script
> 
> Using this, cron should execute my-script on 06:10, 06:20 … 23:50, 00:00, 
> 00:10 …
> 00:50. What you probably want is
> 
> */10 6-23 * * * my-script

In addition to the above, remember that it's possible to supply lists to
cron fields. If you want to span midnight, you probably want something
like:

  */10 0,6-23 * * * my-script

Though this will run every 10 mins in the hours 00:00, 06:00, 07:00
etc. Again, probably not what you want. 6-23 will probably be best.

-- 
Darac Marjal


signature.asc
Description: Digital signature


Re: crontab hour range 6-midnight

2011-12-01 Thread Jochen Spieker
Nicolas Bercher:
> 
> I'd like use set up a crontab rule from 6 am to midnight, and crontab(5) 
> mentions:
>   field  allowed values
>   hour   0-23
> 
> Then, I tried something like:
>   */10 6-0 * * 1-5 my-script

Using this, cron should execute my-script on 06:10, 06:20 … 23:50, 00:00, 00:10 
…
00:50. What you probably want is

*/10 6-23 * * * my-script

But beware that you probably need to use /full/path/to/my-script. $PATH
is probably not what you expect.

> As a more generic question: can we define rules that spans hours,
> days, etc. writing ranges "n-m" where m Cant' find such answers (except by experiencing a lot... and waiting a lot!).

Just try the it with minutes instead of hours.

> Moreover, crontab is happily "installing new crontab" when I use such
> rules, but they don't seem to be treated at all.

You should your job in /var/log/syslog.

J.
-- 
I wish I was gay.
[Agree]   [Disagree]
 


signature.asc
Description: Digital signature


[SOLVED] Re: crontab mails to external smtp host

2011-09-18 Thread Steven
On Sun, 2011-09-18 at 15:17 -0600, Bob Proulx wrote: 
> Steven wrote:
> > I manage several Debian servers (etch and squeeze), not related to one
> > another, and they all have some crontab jobs scheduled such as backup
> > scripts. When these cronjobs are run, the output is e-mailed to the
> > local admin account on the system. Is it possible to configure these
> > e-mails to be delivered to an external address over an external SMTP
> > server instead of locally?
> 
> You can set up an alias for root in /etc/aliases to point to another
> host.  Then all email to root will forward to the other address.
> 
>   root: r...@other.example.com
> 
> Normally after changing the aliases file you need to run 'newaliases'
> to rebuild the cache file.  But I think exim does not need this.
> 
> Alternatively if you only want to change the crontab output and
> nothing else then Vixie Cron (the default for most GNU/Linux distros)
> enables you to set the MAILTO variable.  If your system has a default
> install of exim then very likely you can simply set the address.  Put
> this in your crontab file and it will only affect that particular
> crontab.
> 
>   MAILTO = "r...@other.example.com"

Unfortunately both of these solutions don't work with my default exim
config, as that won't allow you to send to external addresses. The exim
config would need to be changed anyway.

> 
> > All systems where I would want to do this run Squeeze and use exim4 in a
> > default configuration as none of them are e-mail servers.
> 
> But of course exim4 in a default configuration is an email server even
> if you are not thinking of it that way.
> 
> The other suggestion to use nullmailer to simplify the MTA seems
> reasonable to me.  I always use nullmailer for chroots.

I have no experience with nullmailer whatsoever (but none with exim
either), but as it's a separate package I needed to install, and would
need to lookup the config, I figured Juan's exim solution would be the
easiest for me.

> 
> The other suggestion to reconfigure exim to use a smarthost is
> reasonable too.  But I think probably more complicated than you need
> to do for what you are asking.

It does the job for me, and isn't terribly complicated, Juan explained
it exactly as needed.

> 
> Bob

Thanks everyone for helping me out on this one.
Kind regards,
Steven



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


Re: crontab mails to external smtp host

2011-09-18 Thread Steven
On Sun, 2011-09-18 at 22:43 +0200, Juan Sierra Pons wrote:
> Hi,
> 
> Yes, it can be done configuring Exim to send emails to external
> domains using a smarthost.

Excellent.

> 
> 1.- Configure properly /etc/aliases and add a default user to receive
> emails. For example
> 
[...]
> 2.- Configure exim4 to send emails using a external smarthost. As I
> can see you have a gmail account. I have the same configuration in my
> servers.
> 
> Modify your update-exim4.conf.conf and update the dc_smarthost variable:
> dc_smarthost='smtp.gmail.com::587'
> 
> Create the /etc/exim4/passwd.client with the right permission
> -rw-r- 1 root Debian-exim   401 abr 21 21:20 passwd.client
> 
> And add the following:
> # password file used when the local exim is authenticating to a remote
> # host as a client.
> #
> # see exim4_passwd_client(5) for more documentation
> #
> # Example:
> ### target.mail.server.example:login:password
> *.google.com:redalert.comman...@gmail.com:password
> gmail-smtp.l.google.com:redalert.comman...@gmail.com:password
> *.google.com:redalert.comman...@gmail.com:password
> smtp.gmail.com:redalert.comman...@gmail.com:password
> 
> 3.- Restart the exim4 daemon
[...]
It seems you forgot to mention I need to run update-exim4.conf?
But I figured that out.

> 
> Have fun!

Thanks, works like a charm when using gmail :)
Unfortunately I was trying to get it working with a different e-mail
address, one I have with my ISP, yet this didn't work out. When using
that one I got frozen message in the exim queues and a message in the
exim log saying my ISP's smtp rejected the message as unroutable.

But I settled for the gmail solution instead, so I'm satisfied.

Thank you very much.

Kind regards,
Steven




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


Re: crontab mails to external smtp host

2011-09-18 Thread Bob Proulx
Steven wrote:
> I manage several Debian servers (etch and squeeze), not related to one
> another, and they all have some crontab jobs scheduled such as backup
> scripts. When these cronjobs are run, the output is e-mailed to the
> local admin account on the system. Is it possible to configure these
> e-mails to be delivered to an external address over an external SMTP
> server instead of locally?

You can set up an alias for root in /etc/aliases to point to another
host.  Then all email to root will forward to the other address.

  root: r...@other.example.com

Normally after changing the aliases file you need to run 'newaliases'
to rebuild the cache file.  But I think exim does not need this.

Alternatively if you only want to change the crontab output and
nothing else then Vixie Cron (the default for most GNU/Linux distros)
enables you to set the MAILTO variable.  If your system has a default
install of exim then very likely you can simply set the address.  Put
this in your crontab file and it will only affect that particular
crontab.

  MAILTO = "r...@other.example.com"

> All systems where I would want to do this run Squeeze and use exim4 in a
> default configuration as none of them are e-mail servers.

But of course exim4 in a default configuration is an email server even
if you are not thinking of it that way.

The other suggestion to use nullmailer to simplify the MTA seems
reasonable to me.  I always use nullmailer for chroots.

The other suggestion to reconfigure exim to use a smarthost is
reasonable too.  But I think probably more complicated than you need
to do for what you are asking.

Bob


signature.asc
Description: Digital signature


Re: crontab mails to external smtp host

2011-09-18 Thread kuLa
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 18/09/11 21:43, Juan Sierra Pons wrote:
> Hi,
> 
> Yes, it can be done configuring Exim to send emails to external
> domains using a smarthost.

hello
yee but to just send admin emails nullmailer is enough and the easiest
to confiugre from any soft of that kind

- -- 

|_|0|_|  |
|_|_|0| "Heghlu'Meh QaQ jajVam"  |
|0|0|0|  kuLa -  |

gpg --keyserver pgp.mit.edu --recv-keys 0xC100B4CA
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJOdlp7AAoJEOqHloDBALTKQ7kH/j9O3ivZlxzxhN8eiF2FYZZF
0XFpFUpGsWewtnNVKxRAtdtwIz7XFiPVFQFpw0Hy1XcxA8kKN/tnxe/lppqnutkK
vll1ahQ1XTf9TO+Wjsyi6sgsaEJteaClOaakx4/fCh4p1RIMDlykXNfmTu3dnc2P
7YlSk+V7urBC3ypdyXI2+RQbp2kD0m4eAzql74ok8j8mjBt8gJ9vi1XyYNK5DX7h
ghQCZpXyia0HVCt0QPsbkVkckJmyXDyNAsA7c6PgBQ1P0upKHp34EHhuooqcOmbt
6Fa/n4MOveNdOmYjYaLjsTOUGM6TwpZPZiNU2cBae2eSISTymhQXhtTbAMQgCmE=
=CXBt
-END PGP SIGNATURE-


-- 
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/4e765a7b.7010...@kulisz.net



Re: crontab mails to external smtp host

2011-09-18 Thread Juan Sierra Pons
Hi,

Yes, it can be done configuring Exim to send emails to external
domains using a smarthost.

1.- Configure properly /etc/aliases and add a default user to receive
emails. For example

# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: youruser
youruser; redalert.comman...@gmail.com

2.- Configure exim4 to send emails using a external smarthost. As I
can see you have a gmail account. I have the same configuration in my
servers.

Modify your update-exim4.conf.conf and update the dc_smarthost variable:
dc_smarthost='smtp.gmail.com::587'

Create the /etc/exim4/passwd.client with the right permission
-rw-r- 1 root Debian-exim   401 abr 21 21:20 passwd.client

And add the following:
# password file used when the local exim is authenticating to a remote
# host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password
*.google.com:redalert.comman...@gmail.com:password
gmail-smtp.l.google.com:redalert.comman...@gmail.com:password
*.google.com:redalert.comman...@gmail.com:password
smtp.gmail.com:redalert.comman...@gmail.com:password

3.- Restart the exim4 daemon

Have fun!

Regards

Juan

--
Juan Sierra Pons
      j...@elsotanillo.net
Linux User Registered: #257202
http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--



2011/9/18 Steven :
> Hi list,
>
> I manage several Debian servers (etch and squeeze), not related to one
> another, and they all have some crontab jobs scheduled such as backup
> scripts. When these cronjobs are run, the output is e-mailed to the
> local admin account on the system. Is it possible to configure these
> e-mails to be delivered to an external address over an external SMTP
> server instead of locally?
>
> All systems where I would want to do this run Squeeze and use exim4 in a
> default configuration as none of them are e-mail servers.
>
> Any help is appreciated.
>
> Kind regards,
> Steven
>


--
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/CABS=y9vftWdgQv4Gna4b3=ytjcu-d28hx2psgjtbtctmhsh...@mail.gmail.com



Re: crontab permissions problem on /var/spool/cron/crontabs/*

2010-01-24 Thread Todd A. Jacobs
On Sun, Jan 24, 2010 at 01:00:13PM +, Anthony Campbell wrote:

> /var/spool/cron/crontabs/ac: Permission denied

The crontabs directory should be owned by root:crontab, not root:root.

> I don't have any such file in /tmp. 

Nor should you. /usr/bin/crontab works like sudoedit, and uses temp
files rather than editing a crontab in-place. That's what the message is
telling you: the name of the last temp file used to edit the crontab.

-- 
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"


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



Re: crontab permissions problem on /var/spool/cron/crontabs/*

2010-01-24 Thread Wayne

Anthony Campbell wrote:

I get an error when running crontab as user:

/var/spool/cron/crontabs/ac: Permission denied

Googling shows a few people with a similar problem but either no
solution or one that doesn't work here (crontab not having setguid or
not in the crontab group).

The permissions are:

drwx-wx--T 2 root root 4096 Jan 24 10:24 /var/spool/cron/crontabs/
-rwxr-sr-x 1 root crontab 27724 May 13  2009 /usr/bin/crontab*
-rw--- 1 ac crontab 919 Dec  2 10:04 /var/spool/cron/crontabs/ac

These are the same as I get on other computers where crontab works
correctly. I had the nasty thought that my system might have been
compromised but I have no other evidence for that. Chkrootkit doesn't
show anything.

Only possible clue: /var/spoo/cron/crontabs/ac has this:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.xScslJ/crontab installed on Wed Dec  2 10:04:38 2009)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)


I don't have any such file in /tmp. 



Have you tried, as user, 'crontab -e' to edit that users cron entries?

Wayne


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




Re: crontab permissions problem on /var/spool/cron/crontabs/* - SOLVED

2010-01-24 Thread Anthony Campbell
On 24 Jan 2010, Anthony Campbell wrote:

Sorry to follow-up to myself but I solved the problem simply by
reinstalling cron.  I don't know what had happened previously but anyway
it's now working correctly.

Anthony
-- 
Anthony Campbell - a...@acampbell.org.uk 
Microsoft-free zone - Using Debian GNU/Linux 
http://www.acampbell.org.uk - sample my ebooks at
http://www.smashwords.com/profile/view/acampbell


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



Re: crontab job

2009-03-20 Thread Boyd Stephen Smith Jr.
On Friday 20 March 2009 11:05:05 hadi motamedi wrote:
>45 1 * * * find /usr/local/statsvr/counters/main/processed -atime +60 -exec
>rm -f {} ';'
>Can you please let us know what is the meaning of "-atime" & "-exec"
>commands used here ?

"-atime" filters the find results based on the last-access time (atime) of the 
file.  The "+60" argument requires the files to have been accessed 60 or more 
days ago to pass the filter.

"-exec" runs a command on each file that has not already been filtered out.  
The command is terminated with a single semi-colon as an argument.  Any 
argument that is simply "{}" will be replaced with the name of the file being 
processed.

Taken together, the command will remove any file (or empty directory) that has 
not been accessed in the last 60 days.  (It will try to remove non-empty 
directories, but fail.)
-- 
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: crontab job

2009-03-20 Thread T o n g
On Fri, 20 Mar 2009 09:05:05 -0700, hadi motamedi wrote:

>  We have
> received the following instruction command to be set as crontab job for
> root user, as the followings :
> 45 1 * * * find /usr/local/statsvr/counters/main/processed -atime +60
> -exec rm -f {} ';'
> Can you please let us know what is the meaning of "-atime" & "-exec"
> commands used here ?

Do

 man find

then find "-atime", "-exec" with "/". 

FYI, the tmpreaper is handy if you have more than 1 such folders need to 
be cleaned regularly:

 tmpreaper - cleans up files in directories based on their age

-- 
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



Re: crontab command and permissions problem

2009-02-11 Thread Michael Iatrou
When the date was Tuesday 10 February 2009, Jordi Moles Blanco wrote:

> I'm having a problem trying to execute the "crontab" command from a perl
> script.
>
> When i call this command from the SNMP system, i get this:
>
> "must be privileged to use -u"
>
> the procedure is...
>
> 1. i create a cron file for a particular user in
> /var/spool/cron/crontabs/username
> 2. i run "crontab -u username /var/spool/cron/crontabs/username"

You are not running the script as root. You may want to consider setuiding 
your script (chmod +s) and install perl-suid.

-- 
 Michael Iatrou (txnb)


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



Re: crontab email not working

2008-07-29 Thread Sebastian Günther
* Daniel Campbell-Macdonald ([EMAIL PROTECTED]) [28.07.08 21:49]:
> HI list
>  I am new to Debian and I am having trouble with crontab- I can't for the 
> life of me seem to figure out how to get it to send me an email.
> I did the crontab - e thing and
> set up something like the following
>
> [EMAIL PROTECTED]
> */8 * * * * wget http://www.whatismyip.com/automation/n09230945.asp
>
> from this all I get is a series of files in my home folder.
>
> Where to I set up the emailing part for cron?

The setup seems perfectly OK. If your MTA is set up correctly, you 
should get an email if the command spits out any error messages.


But if I look at the cron job if get the impression, that you want get 
the the results of the command send via email.

To accomplish that you should pipe the outcomst to mailx or something 
similar.


Sebastian

-- 
 " Religion ist das Opium des Volkes. "  Karl Marx

 [EMAIL PROTECTED]@N GÜNTHER mailto:[EMAIL PROTECTED]


pgp7BhgqtcGzA.pgp
Description: PGP signature


Re: Crontab doesn't run

2007-11-27 Thread Mailing Lists
On 11/26/07, Jan <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've just installed a system with Debian Etch 4.0 and the crontabs which are 
> edited by users will not be executed.
>
> The cronjobs added by the root user, "crontab -e" will are executed as 
> expected. Jobs added by a regular user, also using "crontab -e" are not 
> executed. For testing puposes I just added a simple:
>
> 0-59 * * * * /bin/date >> /home/jan/date.txt
>
> And for some reason it doesn't run. When I save the crontab I get the message 
> "crontab: installing new crontab".
>

Make sure that the last line of the crontab ends in a newline. Cron
will silently ignore lines without one. I keep a comment as the last
line to avoid this problem.


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



Re: Crontab doesn't run

2007-11-27 Thread Andrei Popescu
On Mon, Nov 26, 2007 at 08:14:36PM +0100, Jan wrote:

[cron not executing user crontabs]

> Any ideas? Help will be greatly appreciated.

Did you have a look at the logs?

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


signature.asc
Description: Digital signature


Re: Crontab doesn't run

2007-11-26 Thread Wayne Topa
Jan([EMAIL PROTECTED]) is reported to have said:
> Hi!
> 
> I've just installed a system with Debian Etch 4.0 and the crontabs which are 
> edited by users will not be executed.
> 
> The cronjobs added by the root user, "crontab -e" will are executed as 
> expected. Jobs added by a regular user, also using "crontab -e" are not 
> executed. For testing puposes I just added a simple:
> 
> 0-59 * * * * /bin/date >> /home/jan/date.txt
> 
> And for some reason it doesn't run. When I save the crontab I get the message 
> "crontab: installing new crontab".
> 
> I also tried it by adding a username:
> 
> 0-59 * * * * jan /bin/date >> /home/jan/date.txt
> 
> But it also fails and doesn't run.
> 

ISTR that when using the 'crontab -e' you do not put the use name in
the script.  ie

0-59 * * * * /bin/date >> /home/jan/date.txt

Yep.. verified here.

W

-- 
Windows is NOT a virus. Viruses DO something.
___


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



Re: crontab -e

2007-09-05 Thread Andrei Popescu
On Wed, Sep 05, 2007 at 10:43:16AM -0500, Ron Johnson wrote:
> On 09/03/07 19:46, Douglas A. Tutty wrote:
> > On Mon, Sep 03, 2007 at 05:22:28PM -0700, Raquel wrote:
> >> I have a new install of Etch.  When I issue the command
> >>   #crontab -e
> >> I get the nano editor.  I would really rather use the vim editor. 
> >> How do I change what gets used?
> > 
> > Do you have an EDITOR environment variable set?  The man page says that
> > it follows EDITOR or VISUAL if set.  If not, it likely follows
> > sensible-editor which is part of the debian alternatives system.
> 
> vim not installed???
> 
> Who doesn't install vim?

I didn't. Until I switched to mutt and went "shopping" for a mcedit 
replacement ... so I ended up with vim.

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


signature.asc
Description: Digital signature


Re: crontab -e

2007-09-05 Thread Jeff D

On Wed, 5 Sep 2007, Maarten Verwijs wrote:


On Mon, Sep 03, 2007 at 05:38:03PM -0700, Raquel wrote:

On Tue, 04 Sep 2007 02:24:16 +0200
Mathias Brodala <[EMAIL PROTECTED]> wrote:
Hmmm, I thought it was configured using the update-alternatives
system.  However, when I run (as root):
  #update-alternatives --set editor /usr/bin/vim
I get an error:
  #update-alternatives: Cannot find alternative `/usr/bin/vim'.


This just means that vim isn't installed. Run 'apt-get install vim' and
it should work.



I'm guessing that /usr/bin/vim is really a symlink to the vim in 
/etc/alternatives/vim.  running update-alternatives --set editor 
/usr/bin/vim.tiny or which ever vim you have installed would work.
Although, its probably just easier to just run update-alternatives 
--config editor and select which one you want.


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: crontab -e

2007-09-05 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/03/07 19:46, Douglas A. Tutty wrote:
> On Mon, Sep 03, 2007 at 05:22:28PM -0700, Raquel wrote:
>> I have a new install of Etch.  When I issue the command
>>   #crontab -e
>> I get the nano editor.  I would really rather use the vim editor. 
>> How do I change what gets used?
> 
> Do you have an EDITOR environment variable set?  The man page says that
> it follows EDITOR or VISUAL if set.  If not, it likely follows
> sensible-editor which is part of the debian alternatives system.

vim not installed???

Who doesn't install vim?

- --
Ron Johnson, Jr.
Jefferson LA  USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

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

iD8DBQFG3s6US9HxQb37XmcRAoKCAJ9R/m6sVtgDV6NZu4JOBM04f7eNBgCgtV2J
BgHzJtc0zzjRbBflb6RdKs4=
=piww
-END PGP SIGNATURE-


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



Re: crontab -e

2007-09-05 Thread Maarten Verwijs
On Mon, Sep 03, 2007 at 05:38:03PM -0700, Raquel wrote:
> On Tue, 04 Sep 2007 02:24:16 +0200
> Mathias Brodala <[EMAIL PROTECTED]> wrote:
> Hmmm, I thought it was configured using the update-alternatives
> system.  However, when I run (as root):
>   #update-alternatives --set editor /usr/bin/vim
> I get an error:
>   #update-alternatives: Cannot find alternative `/usr/bin/vim'.

This just means that vim isn't installed. Run 'apt-get install vim' and
it should work.



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



Re: crontab -e

2007-09-03 Thread Graham
On Mon, 3 Sep 2007 17:38:03 -0700
Raquel <[EMAIL PROTECTED]> wrote:

> Hmmm, I thought it was configured using the update-alternatives
> system.  However, when I run (as root):
>   #update-alternatives --set editor /usr/bin/vim
> I get an error:
>   #update-alternatives: Cannot find alternative `/usr/bin/vim'.

Use "#update-alternatives --set editor /usr/vim/vim.basic".

Alternatively, use "#update-alternatives --config editor" to get the
interactive configuration.


Graham


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



Re: crontab -e

2007-09-03 Thread Douglas A. Tutty
On Mon, Sep 03, 2007 at 05:22:28PM -0700, Raquel wrote:
> I have a new install of Etch.  When I issue the command
>   #crontab -e
> I get the nano editor.  I would really rather use the vim editor. 
> How do I change what gets used?

Do you have an EDITOR environment variable set?  The man page says that
it follows EDITOR or VISUAL if set.  If not, it likely follows
sensible-editor which is part of the debian alternatives system.

Doug.


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



Re: crontab -e

2007-09-03 Thread Raquel
On Tue, 4 Sep 2007 02:32:39 +0200
"Jan C. Nordholz" <[EMAIL PROTECTED]> wrote:

> > Raquel, 04.09.2007 02:22:
> > > I have a new install of Etch.  When I issue the command
> > >   #crontab -e
> > > I get the nano editor.  I would really rather use the vim
> > > editor.  How do I change what gets used?
> > 
> > Set the EDITOR environment variable in the config file of your
> > preferred shell. (~/.bashrc for Bash)
> 
> Or, if you want to change the system-wide default, run (as root)
> 
> ] update-alternatives --config editor
> 
> 
> Regards,
> 
> Jan
> 

Thank you!  This worked like a charm.

-- 
Raquel

Constitutions should consist only of general provisions; the reason
is that they must necessarily be permanent, and that they cannot
calculate for the possible change of things.
  --Alexander Hamilton


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



Re: crontab -e

2007-09-03 Thread Raquel
On Tue, 04 Sep 2007 02:24:16 +0200
Mathias Brodala <[EMAIL PROTECTED]> wrote:

> Hi Raquel.
> 
> Raquel, 04.09.2007 02:22:
> > I have a new install of Etch.  When I issue the command
> >   #crontab -e
> > I get the nano editor.  I would really rather use the vim
> > editor.  How do I change what gets used?
> 
> Set the EDITOR environment variable in the config file of your
> preferred shell. (~/.bashrc for Bash)
> 
> 
> Regards, Mathias
> 
> -- 
> debian/rules
> 
> 

Hmmm, I thought it was configured using the update-alternatives
system.  However, when I run (as root):
  #update-alternatives --set editor /usr/bin/vim
I get an error:
  #update-alternatives: Cannot find alternative `/usr/bin/vim'.

-- 
Raquel

Constitutions should consist only of general provisions; the reason
is that they must necessarily be permanent, and that they cannot
calculate for the possible change of things.
  --Alexander Hamilton


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



Re: crontab -e

2007-09-03 Thread Jan C. Nordholz
> Raquel, 04.09.2007 02:22:
> > I have a new install of Etch.  When I issue the command
> >   #crontab -e
> > I get the nano editor.  I would really rather use the vim editor. 
> > How do I change what gets used?
> 
> Set the EDITOR environment variable in the config file of your preferred 
> shell.
> (~/.bashrc for Bash)

Or, if you want to change the system-wide default, run (as root)

] update-alternatives --config editor


Regards,

Jan


signature.asc
Description: Digital signature


Re: crontab -e

2007-09-03 Thread Mathias Brodala
Hi Raquel.

Raquel, 04.09.2007 02:22:
> I have a new install of Etch.  When I issue the command
>   #crontab -e
> I get the nano editor.  I would really rather use the vim editor. 
> How do I change what gets used?

Set the EDITOR environment variable in the config file of your preferred shell.
(~/.bashrc for Bash)


Regards, Mathias

-- 
debian/rules



signature.asc
Description: OpenPGP digital signature


Re: Crontab Problem

2006-12-20 Thread Michelle Konzack
Am 2006-12-07 22:34:06, schrieb Grok Mogger:
> I tried doing something like this in the system wide crontab 
> (/etc/crontab) and I was disappointed to find that it didn't 
> work.  It seems like the job just never ran at all.  Can anyone 
> tell me what might have happened?
> 
> (This is of course supposed to be on one line)
> 
> 00 22 * * * root nice /some/place/myscript.sh 1> 
> /other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
^^ ^
> +%F`.errors
 ^
 This do not work in crontabs

You must put your EXEC string in a script file end then execute it.

Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
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/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: Crontab Problem

2006-12-09 Thread Ken Irving
On Sat, Dec 09, 2006 at 09:18:48PM -0600, W Paul Mills wrote:
> Ken Irving wrote:
> > On Sat, Dec 09, 2006 at 08:13:22PM -0500, Bill Marcum wrote:
> >> The % sign has a special meaning in crontabs.  Change it to \%.
> > 
> > I don't see any hint of that in crontab(1) or cron(8), but I do see 
> > some hits on google that talk about it.  I've looked on stable
> > and unstable, not testing.  Are the manpages in error?
> > 
> 
> man 5 crontab

... oops, missed that.  I thought I'd checked the SEE ALSOs, but
obviously not.  Thanks,

Ken

-- 
Ken Irving, [EMAIL PROTECTED]


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



Re: Crontab Problem

2006-12-09 Thread W Paul Mills
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ken Irving wrote:
> On Sat, Dec 09, 2006 at 08:13:22PM -0500, Bill Marcum wrote:
>> On Thu, Dec 07, 2006 at 10:34:06PM -0500, Grok Mogger wrote:
>>> I tried doing something like this in the system wide crontab 
>>> (/etc/crontab) and I was disappointed to find that it didn't 
>>> work.  It seems like the job just never ran at all.  Can anyone 
>>> tell me what might have happened?
>>>
>>> (This is of course supposed to be on one line)
>>>
>>> 00 22 * * * root nice /some/place/myscript.sh 1> 
>>> /other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
>>> +%F`.errors
>>>
>> The % sign has a special meaning in crontabs.  Change it to \%.
> 
> I don't see any hint of that in crontab(1) or cron(8), but I do see 
> some hits on google that talk about it.  I've looked on stable
> and unstable, not testing.  Are the manpages in error?
> 

man 5 crontab


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFe3yXu4tRirKTPYwRAhEHAJ9WKppb/u0vaEghU05a3ZEsfXnNNgCaAl6E
IZddM9GYwi00hEyLaAGGWzs=
=EHw6
-END PGP SIGNATURE-
begin:vcard
fn:W Paul Mills
n:Mills;W Paul
org:The Mills Chaos In The USA
adr:;;;Topeka;Kansas;;USA
email;internet:[EMAIL PROTECTED]
title:Electronics Technician
note:Hint: remove -NOT
x-mozilla-html:FALSE
url:http://Mills-USA.com
version:2.1
end:vcard



Re: Crontab Problem

2006-12-09 Thread Ken Irving
On Sat, Dec 09, 2006 at 08:13:22PM -0500, Bill Marcum wrote:
> On Thu, Dec 07, 2006 at 10:34:06PM -0500, Grok Mogger wrote:
> > I tried doing something like this in the system wide crontab 
> > (/etc/crontab) and I was disappointed to find that it didn't 
> > work.  It seems like the job just never ran at all.  Can anyone 
> > tell me what might have happened?
> > 
> > (This is of course supposed to be on one line)
> > 
> > 00 22 * * * root nice /some/place/myscript.sh 1> 
> > /other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
> > +%F`.errors
> > 
> The % sign has a special meaning in crontabs.  Change it to \%.

I don't see any hint of that in crontab(1) or cron(8), but I do see 
some hits on google that talk about it.  I've looked on stable
and unstable, not testing.  Are the manpages in error?

-- 
Ken Irving, [EMAIL PROTECTED]


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



Re: Crontab Problem

2006-12-09 Thread Bill Marcum
On Thu, Dec 07, 2006 at 10:34:06PM -0500, Grok Mogger wrote:
> I tried doing something like this in the system wide crontab 
> (/etc/crontab) and I was disappointed to find that it didn't 
> work.  It seems like the job just never ran at all.  Can anyone 
> tell me what might have happened?
> 
> (This is of course supposed to be on one line)
> 
> 00 22 * * * root nice /some/place/myscript.sh 1> 
> /other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
> +%F`.errors
> 
The % sign has a special meaning in crontabs.  Change it to \%.



-- 
Baseball is a skilled game.  It's America's game - it, and high taxes.
-- The Best of Will Rogers


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



Re: Crontab Problem

2006-12-08 Thread Grok Mogger

Russell L. Harris wrote:

* Grok Mogger <[EMAIL PROTECTED]> [061207 21:39]:
I tried doing something like this in the system wide crontab 
(/etc/crontab) and I was disappointed to find that it didn't 
work.  It seems like the job just never ran at all.  Can anyone 
tell me what might have happened?


(This is of course supposed to be on one line)

00 22 * * * root nice /some/place/myscript.sh 1> 
/other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
+%F`.errors


Did you have a blank line at the end of the crontab entry?  


From the crontab man page:


Although cron requires that each entry in a crontab end in a
newline character, neither the crontab command nor the cron daemon
will detect this error. Instead, the crontab will appear to load
normally. However, the command will never run. The best choice is
to ensure that your crontab has a blank line at the end.

RLH




Thanks, I haven't figured out what was wrong for certain, but I 
bet that was it.  I didn't realize that was an issue with cron.


Thanks,
- GM


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/580 - Release Date: 12/8/2006 
12:53 PM


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




Re: Crontab Problem

2006-12-07 Thread Russell L. Harris
* Grok Mogger <[EMAIL PROTECTED]> [061207 21:39]:
> I tried doing something like this in the system wide crontab 
> (/etc/crontab) and I was disappointed to find that it didn't 
> work.  It seems like the job just never ran at all.  Can anyone 
> tell me what might have happened?
> 
> (This is of course supposed to be on one line)
> 
> 00 22 * * * root nice /some/place/myscript.sh 1> 
> /other/place/logs/`date +%F`.output 2> /other/place/logs/`date 
> +%F`.errors

Did you have a blank line at the end of the crontab entry?  

>From the crontab man page:

Although cron requires that each entry in a crontab end in a
newline character, neither the crontab command nor the cron daemon
will detect this error. Instead, the crontab will appear to load
normally. However, the command will never run. The best choice is
to ensure that your crontab has a blank line at the end.

RLH


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



Re: crontab permissions

2006-07-01 Thread Andrew Sackville-West
On Sat, Jul 01, 2006 at 08:46:33PM +0200, Dimitar Vukman wrote:
> On Sat, 1 Jul 2006 11:36:18 -0700
> Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> 
> > no i haven't, but its solved. My /usr/bin/crontab had the wrong
> > permissions -- it was owner:group root:root instead of root:crontab
> > with gid. that's fixed now and it works whether I am in the crontab
> > group or not. 
> > 
> > thanks for you help
> 
> 
> I'm glad you got it fixed soon. :)
> 

debian-user r0x0rz!!! ;-)

A


signature.asc
Description: Digital signature


Re: crontab permissions

2006-07-01 Thread Dimitar Vukman
On Sat, 1 Jul 2006 11:36:18 -0700
Andrew Sackville-West <[EMAIL PROTECTED]> wrote:

> no i haven't, but its solved. My /usr/bin/crontab had the wrong
> permissions -- it was owner:group root:root instead of root:crontab
> with gid. that's fixed now and it works whether I am in the crontab
> group or not. 
> 
> thanks for you help


I'm glad you got it fixed soon. :)



-- 
"Infinite Love Is The Only Truth, Everything Else Is Illusion!"
  PGP:0xE6359031 ICQ:32812963 MSN:[EMAIL PROTECTED]


signature.asc
Description: PGP signature


Re: crontab permissions

2006-07-01 Thread Andrew Sackville-West
On Sat, Jul 01, 2006 at 07:56:53PM +0200, Dimitar Vukman wrote:
> On Sat, 1 Jul 2006 10:33:31 -0700
> Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> 
> > hmm... that doesn't do it., but I'm not in the crontab group, are you?
> 
> Neithere am I. 
> Have you tried deleting the /var/spool/crontabs/* ? 

no i haven't, but its solved. My /usr/bin/crontab had the wrong
permissions -- it was owner:group root:root instead of root:crontab
with gid. that's fixed now and it works whether I am in the crontab
group or not. 

thanks for you help

A


> 
> -- 
> "Infinite Love Is The Only Truth, Everything Else Is Illusion!"
>   PGP:0xE6359031 ICQ:32812963 MSN:[EMAIL PROTECTED]




signature.asc
Description: Digital signature


Re: crontab permissions [solved?]

2006-07-01 Thread Andrew Sackville-West
On Sat, Jul 01, 2006 at 10:12:50AM -0800, Ken Irving wrote:
> On Sat, Jul 01, 2006 at 10:33:31AM -0700, Andrew Sackville-West wrote:
> > On Sat, Jul 01, 2006 at 06:39:17PM +0200, Dimitar Vukman wrote:
> > > Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> > > 
> > > > can someone provide their permissions, group and owner settings or
> > > > perhaps some other insight?
> > > 
> > > [06:38 PM Sat Jul [EMAIL PROTECTED]:/var/spool/cron/crontabs
> > > # ls -al
> > > total 12
> > > drwx-wx--T  2 root crontab 4096 2006-05-27 11:44 .
> > > drwxr-xr-x  5 root root4096 2005-08-17 20:52 ..
> > > -rw---  1 mito crontab  191 2005-10-06 23:33 mito
> > > 
> > > 
> > > Hope it helps!
> > 
> > hmm... that doesn't do it., but I'm not in the crontab group, are you?
> > It seems strange that a file would have an owner that is not in the
> > same group as the file's group. 
> 
> The crontab executable has gid set so runs as group crontab:
> 
> $ ls -l `which crontab`
> -rwxr-sr-x 1 root crontab 26668 Mar 31 16:43 /usr/bin/crontab
> 
> Otherwise my permissions are as above.
> 

okay, that did it. I was at:

[EMAIL PROTECTED]:/var/spool/cron$ ls -l `which crontab`
-rwxr-sr-x 1 root root 27K 2006-05-04 14:16 /usr/bin/crontab


did a:

 chown root:crontab /usr/bin/crontab
 chmod g+s /usr/bin/crontab

and now it works as I expect. I wonder, though, how that came to be...

thanks.

A


signature.asc
Description: Digital signature


Re: crontab permissions

2006-07-01 Thread Andrew Sackville-West
On Sat, Jul 01, 2006 at 08:02:58PM +0200, Dimitar Vukman wrote:
> On Sat, 1 Jul 2006 10:33:31 -0700
> Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> 
> 
> > hmm... that doesn't do it., but I'm not in the crontab group, are you?
> > It seems strange that a file would have an owner that is not in the
> > same group as the file's group. 
> 
> I've got an idea. What are your permissions on /tmp ? That's there a
> file gets created when you issue crontab -e. 

good thought:

[EMAIL PROTECTED]:/var/spool/cron$ ls -al /tmp
total 20K
drwxrwxrwt 11 root   root280 2006-07-01 11:26 .
drwxr-xr-x 27 root   root   4.0K 2006-06-21 13:53 ..
drwx--  3 andrew andrew   60 2006-07-01 11:08 gconfd-andrew
drwx--  2 andrew andrew   60 2006-06-30 18:25 gpg-89eV9I
drwx--  2 andrew andrew   60 2006-06-30 18:25 gpg-FZpbiN
drwx--  2 andrew andrew   60 2006-06-30 18:25 gpg-Kk0Lez
drwxrwxrwt  2 root   root 60 2006-06-30 18:25 .ICE-unix
drwx--  2 andrew andrew   80 2006-07-01 11:08 orbit-andrew
drwx--  2 andrew andrew   60 2006-06-30 18:25 ssh-dHwHnb4222
drwx--  2 andrew andrew   60 2006-06-30 18:25 ssh-Idrdpv4222
-r--r--r--  1 root   root 11 2006-06-30 18:25 .X0-lock
drwxrwxrwt  2 root   root 60 2006-06-30 18:25 .X11-unix
-rw---  1 andrew andrew  207 2006-06-30 18:25 .xfsm-ICE-t5MJNT
-rw---  1 andrew andrew 4.3K 2006-07-01 09:20 zmanl3vHqv
[EMAIL PROTECTED]:/var/spool/cron$ ls -al / | grep tmp
drwxrwxrwt  11 root  root280 2006-07-01 11:26 tmp

that looks okay to me, but I'm not sure. I've messed with /tmp in the
past when there were problems with X starting (long time ago) and it
was a permissions issue with /tmp. So I nuked the problem with chmod
1777 /tmp, IIRC.

A



signature.asc
Description: Digital signature


Re: crontab permissions

2006-07-01 Thread Ken Irving
On Sat, Jul 01, 2006 at 10:33:31AM -0700, Andrew Sackville-West wrote:
> On Sat, Jul 01, 2006 at 06:39:17PM +0200, Dimitar Vukman wrote:
> > Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> > 
> > > can someone provide their permissions, group and owner settings or
> > > perhaps some other insight?
> > 
> > [06:38 PM Sat Jul [EMAIL PROTECTED]:/var/spool/cron/crontabs
> > # ls -al
> > total 12
> > drwx-wx--T  2 root crontab 4096 2006-05-27 11:44 .
> > drwxr-xr-x  5 root root4096 2005-08-17 20:52 ..
> > -rw---  1 mito crontab  191 2005-10-06 23:33 mito
> > 
> > 
> > Hope it helps!
> 
> hmm... that doesn't do it., but I'm not in the crontab group, are you?
> It seems strange that a file would have an owner that is not in the
> same group as the file's group. 

The crontab executable has gid set so runs as group crontab:

$ ls -l `which crontab`
-rwxr-sr-x 1 root crontab 26668 Mar 31 16:43 /usr/bin/crontab

Otherwise my permissions are as above.

Ken

-- 
Ken Irving, [EMAIL PROTECTED]


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



Re: crontab permissions

2006-07-01 Thread Dimitar Vukman
On Sat, 1 Jul 2006 10:33:31 -0700
Andrew Sackville-West <[EMAIL PROTECTED]> wrote:


> hmm... that doesn't do it., but I'm not in the crontab group, are you?
> It seems strange that a file would have an owner that is not in the
> same group as the file's group. 

I've got an idea. What are your permissions on /tmp ? That's there a
file gets created when you issue crontab -e. 


-- 
"Infinite Love Is The Only Truth, Everything Else Is Illusion!"
  PGP:0xE6359031 ICQ:32812963 MSN:[EMAIL PROTECTED]


signature.asc
Description: PGP signature


Re: crontab permissions

2006-07-01 Thread Dimitar Vukman
On Sat, 1 Jul 2006 10:33:31 -0700
Andrew Sackville-West <[EMAIL PROTECTED]> wrote:

> hmm... that doesn't do it., but I'm not in the crontab group, are you?

Neithere am I. 
Have you tried deleting the /var/spool/crontabs/* ? 

-- 
"Infinite Love Is The Only Truth, Everything Else Is Illusion!"
  PGP:0xE6359031 ICQ:32812963 MSN:[EMAIL PROTECTED]


signature.asc
Description: PGP signature


Re: crontab permissions

2006-07-01 Thread Andrew Sackville-West
On Sat, Jul 01, 2006 at 06:39:17PM +0200, Dimitar Vukman wrote:
> On Sat, 1 Jul 2006 09:27:39 -0700
> Andrew Sackville-West <[EMAIL PROTECTED]> wrote:
> 
> > can someone provide their permissions, group and owner settings or
> > perhaps some other insight?
> > 
> > A
> 
> 
> [06:38 PM Sat Jul [EMAIL PROTECTED]:/var/spool/cron/crontabs
> # ls -al
> total 12
> drwx-wx--T  2 root crontab 4096 2006-05-27 11:44 .
> drwxr-xr-x  5 root root4096 2005-08-17 20:52 ..
> -rw---  1 mito crontab  191 2005-10-06 23:33 mito
> 
> 
> Hope it helps!

hmm... that doesn't do it., but I'm not in the crontab group, are you?
It seems strange that a file would have an owner that is not in the
same group as the file's group. 

A



signature.asc
Description: Digital signature


Re: crontab permissions

2006-07-01 Thread Dimitar Vukman
On Sat, 1 Jul 2006 09:27:39 -0700
Andrew Sackville-West <[EMAIL PROTECTED]> wrote:

> can someone provide their permissions, group and owner settings or
> perhaps some other insight?
> 
> A


[06:38 PM Sat Jul [EMAIL PROTECTED]:/var/spool/cron/crontabs
# ls -al
total 12
drwx-wx--T  2 root crontab 4096 2006-05-27 11:44 .
drwxr-xr-x  5 root root4096 2005-08-17 20:52 ..
-rw---  1 mito crontab  191 2005-10-06 23:33 mito


Hope it helps!



-- 
"Infinite Love Is The Only Truth, Everything Else Is Illusion!"
  PGP:0xE6359031 ICQ:32812963 MSN:[EMAIL PROTECTED]


signature.asc
Description: PGP signature


Re: Crontab problems

2005-08-16 Thread Phantazm
Hi.

I've checked all except one thing.
3. Do your crontabs end with a blank line?

And i'll be damned :-) it did solve the problem. haha
Wierd though. When i enter the crontab there was a blank line. i deleted it 
and hit enter twice and it worked.

Thank you very much mate.

Time to convert all /etc/crontab to the users. :-) 




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



Re: Crontab problems

2005-08-16 Thread Maurits van Rees
On Tue, Aug 16, 2005 at 11:29:56AM +0200, Phantazm wrote:
> Aas i said really wierd :-)
> everything looks ok.

Yes, it looks ok (at least from my not too knowledgeable viewpoint).
Please remind me: does the crontab work for root?

Then I can only say: look at the man page for crontab, which brings up
the following questions:

1. If you have a file /etc/cron.allow what are its contents?

2. If you have a file /etc/cron.deny what are its contents?  (I don't
have these files, which seems to work alright.)

3. Do your crontabs end with a blank line? (They should.)

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
"It can seem like you're doing just fine,
but the creep's creeping into your mind." - Neal Morse


signature.asc
Description: Digital signature


Re: Crontab problems

2005-08-16 Thread Phantazm
Hi.

Aas i said really wierd :-)
everything looks ok.

camelot:~# echo ls | at now
warning: commands will be executed using /bin/sh
job 1 at 2005-08-16 11:23
camelot:~# ls -l /var/spool/cron/
total 0
drwx--  2 daemon daemon  17 2005-08-16 11:23 atjobs
drwx--  2 daemon daemon   6 2005-08-16 11:23 atspool
drwx-wx--T  2 root   crontab 32 2005-08-13 19:07 crontabs
camelot:~# ls -l /var/spool/cron/*
/var/spool/cron/atjobs:
total 0

/var/spool/cron/atspool:
total 0

/var/spool/cron/crontabs:
total 8
-rw---  1 phantazm crontab 201 2005-08-13 19:07 phantazm
-rw---  1 root crontab 414 2005-08-13 15:14 root
camelot:~#
--

When using the "at" i also get the mail that it has run.

i really dont have a clue of what to do :-(

Thank you for your time and effort, really appreciated.

/Christian




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



Re: Crontab problems

2005-08-16 Thread Maurits van Rees
On Tue, Aug 16, 2005 at 09:25:50AM +0200, Phantazm wrote:
> I cant get user crontabs to work.
> 
> cron is running
> crontab -l gives correct output.
> EVERYTHING looks fine. I've must have missed something.

Does the 'at' command work?  It does something similar and also uses
the cron daemon, as far as I know.  Just try something simple as the
following and see if you get any output on screen and get an email:

[EMAIL PROTECTED]:~$ echo ls | at now
warning: commands will be executed using /bin/sh
job 136 at 2005-08-16 10:24

Also, what does your /var/spool/cron/ directory look like?  Maybe some
permissions or owner/group settings have gone awry.  Here is the
output on my system:

[EMAIL PROTECTED]:~$ ls -l /var/spool/cron/
totaal 0
drwx--  2 daemon daemon  72 2005-08-16 10:24 atjobs
drwx--  2 daemon daemon  48 2005-08-16 10:24 atspool
drwx-wx--T  2 root   crontab 96 2005-08-14 00:50 crontabs

As a small test I tried this in my crontab:
35 10 * * * hello_world
which obviously failed, but at least the crontab was executed and I
got an error message in the mail.

BTW, no cron problems on my system.  Here is my 7:30 alarm clock in
crontab. :)

30 7 * * * /usr/bin/ogg123 -q /music/Neal_Morse/One/08.Reunion.ogg

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
"It can seem like you're doing just fine,
but the creep's creeping into your mind." - Neal Morse


signature.asc
Description: Digital signature


Re: crontab every 5 minutes?

2004-12-26 Thread Stefan Drees
Hello,
try this*/5 * * *
for other exsamples see "man 5 crontab"
Bye
Lance Hoffmeyer schrieb:
Hello,
How do I get crontab to run a process every 5 minutes?
Currently, it is setup as:
5,10,15,20,25,30,35,40,45,50,55 * * * 

Surely, there is a more elegant approach?
Lance


 


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



Re: crontab every 5 minutes?

2004-12-24 Thread Tom Allison
Lance Hoffmeyer wrote:
Hello,
How do I get crontab to run a process every 5 minutes?
Currently, it is setup as:
5,10,15,20,25,30,35,40,45,50,55 * * * 

Surely, there is a more elegant approach?
Lance
if you use the notation
*/5 * * * *
then it will run every five minutes, but not always on the 5 (ie: 00, 
05, 10, 15...)

If you have to run on the five, then you need to use the notation you've 
provided, but add '00'

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



Re: crontab every 5 minutes?

2004-12-24 Thread Miquel van Smoorenburg
In article <[EMAIL PROTECTED]>,
Joao Clemente  <[EMAIL PROTECTED]> wrote:
>Now, I must wonder: Is there a way to "shift" this by a wanted value? 
>(for instance, when x MOD y = 1, something like putting into cron the 
>instance (*/5)+1  ? It would run at 1,6,11,16,21, ... Is it possible?

Perhaps 1-59/5 ? From the manpage I get the impression that
that would work.

Mike.


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



Re: crontab every 5 minutes?

2004-12-23 Thread Andreas
> Sorry to post over your answer, but Andreas, this is not correct: you 
> should have written
> */5
> or
> 0-59/5
> 
> (every 5 minutes... your versions was "every 12 minutes". The '/' is not 
> "divide the time into y parts" but "every time 'x MOD y = 0' then run")

Indeed, I got that wrong.
Adam, Joao, thanks for pointing it out to me. 
Sorry for any confusion caused.

Regards,
Andreas


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



Re: crontab every 5 minutes?

2004-12-23 Thread Joao Clemente
Andreas wrote:
On Thu, Dec 23, 2004 at 08:02:55PM -0600, Lance Hoffmeyer wrote:
Hello,
How do I get crontab to run a process every 5 minutes?
Currently, it is setup as:
5,10,15,20,25,30,35,40,45,50,55 * * * 

Surely, there is a more elegant approach?
Lance
sure
*/12 * * * *
or
0-59/12 * * * *
should do it.
Sorry to post over your answer, but Andreas, this is not correct: you 
should have written
*/5
or
0-59/5

(every 5 minutes... your versions was "every 12 minutes". The '/' is not 
"divide the time into y parts" but "every time 'x MOD y = 0' then run")

For who is not used to "MOD", this is the same as "%" in some 
programming languages: MOD = Remainder of division
0%5 = 0
1%5 = 1
2%5 = 2
3%5 = 3
4%5 = 4
5%5 = 0
6%5 = 1
...

(Someone has already posted the solution, I just reply to your mail so 
that this is lot left alone and (possibly) confusing someone)

Now, I must wonder: Is there a way to "shift" this by a wanted value? 
(for instance, when x MOD y = 1, something like putting into cron the 
instance (*/5)+1  ? It would run at 1,6,11,16,21, ... Is it possible?

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



Re: crontab every 5 minutes?

2004-12-23 Thread Adam Aube
Andreas wrote:

> On Thu, Dec 23, 2004 at 08:02:55PM -0600, Lance Hoffmeyer wrote:
>> How do I get crontab to run a process every 5 minutes?
>> Currently, it is setup as:
>> 5,10,15,20,25,30,35,40,45,50,55 * * *
>> 
>> Surely, there is a more elegant approach?

> sure
> 
> */12 * * * *
> or
> 0-59/12 * * * *
> 
> should do it.

That would make it run 5 times per hour, not every five minutes.

Adam


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



Re: crontab every 5 minutes?

2004-12-23 Thread Andreas
On Thu, Dec 23, 2004 at 08:02:55PM -0600, Lance Hoffmeyer wrote:
> Hello,
> 
> How do I get crontab to run a process every 5 minutes?
> Currently, it is setup as:
> 5,10,15,20,25,30,35,40,45,50,55 * * * 
> 
> Surely, there is a more elegant approach?
> 
> Lance

sure

*/12 * * * *
or
0-59/12 * * * *

should do it.

  regards,
Andreas.



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



Re: crontab every 5 minutes?

2004-12-23 Thread Ron Johnson
On Thu, 2004-12-23 at 20:02 -0600, Lance Hoffmeyer wrote:
> Hello,
> 
> How do I get crontab to run a process every 5 minutes?
> Currently, it is setup as:
> 5,10,15,20,25,30,35,40,45,50,55 * * * 
> 
> Surely, there is a more elegant approach?

Yes, yes there is.

$ man crontab
  SEE ALSO
 crontab(5), cron(8)

$ man 5 crontab
   Step values can be used  in  conjunction  with  ranges.
   Following a range with ``/'' specifies skips of
   the number's value through  the  range.   For  example,
   ``0-23/2''  can  be  used in the hours field to specify
   command execution every other hour (the alternative  in
   the V7 standard is ``0,2,4,6,8,10,12,14,16,18,20,22'').
   Steps are also permitted after an asterisk, so  if  you
   want to say ``every two hours'', just use ``*/2''.

-- 
-
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B I prefer encrypted mail.

"He was about as useful in a crisis as a sheep."
Dorothy Eden



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


Re: crontab every 5 minutes?

2004-12-23 Thread Robert Vangel
Just noticed with the example below, there would be a 10 minute gap 
between 55 & 5 (need 0,5,10,[...],55)

Lance Hoffmeyer wrote:
Hello,
How do I get crontab to run a process every 5 minutes?
Currently, it is setup as:
5,10,15,20,25,30,35,40,45,50,55 * * * 

Surely, there is a more elegant approach?
Lance





smime.p7s
Description: S/MIME Cryptographic Signature


Re: crontab every 5 minutes?

2004-12-23 Thread Robert Vangel
*/5 * * *
Lance Hoffmeyer wrote:
Hello,
How do I get crontab to run a process every 5 minutes?
Currently, it is setup as:
5,10,15,20,25,30,35,40,45,50,55 * * * 

Surely, there is a more elegant approach?
Lance





smime.p7s
Description: S/MIME Cryptographic Signature


Re: crontab uid ?

2004-12-20 Thread Kevin Coyner


On Sat, Dec 18, 2004 at 02:17:19AM +1100, Sam Watkins wrote..

> On Mon, Dec 20, 2004 at 06:54:01AM -0500, Kevin Coyner wrote:
> >/usr/bin/br: error: [Input/output error] ioctl
> 
> if you're not sure what user it's running as, try running "whoami" in
> the crontab.  although if it's root's crontab it should definitely be
> running as root.

Tried this, and got 'root', which is what we would have expected.


> I assume if you run this progam yourself it doesn't give that error.

You assume correctly.  If running myself (non-root user) from crontab or
from the CLI, I don't get the error.


> Trying putting "strace -f br" or "ltrace -Sf br" instead of "br" in cron
> and see what it's doing when it fails.

I ran it with strace, and here's a brief snippet of what appears to be
the relevant output:

open("/dev/firecracker", O_RDONLY|O_NONBLOCK) = 3
ioctl(3, TIOCMGET, [TIOCM_DTR|TIOCM_RTS|0x4000]) = 0
ioctl(3, TIOCMBIS, [TIOCM_DTR|TIOCM_RTS]) = 0
gettimeofday({1103564221, 329195}, NULL) = 0
gettimeofday({1103564221, 329245}, NULL) = 0
gettimeofday({1103564221, 329294}, NULL) = 0
gettimeofday({1103564221, 329343}, NULL) = 0
.

The gettimeofday() stuff goes on and on and on ...

So it seems to be a problem when root tries to open up the serial port
(via /dev/firecracker) and execute the 'gettimeofday' function.

I've got the crontab running successfully now as another non-root user,
but I'm still kind of curious as to what all this means.

Thanks
Kevin

-- 
Kevin Coyner  GnuPG key: 1024D/8CE11941  http://rustybear.com/pubkey.php


signature.asc
Description: Digital signature


Re: crontab uid ?

2004-12-20 Thread Sam Watkins
On Mon, Dec 20, 2004 at 06:54:01AM -0500, Kevin Coyner wrote:
>/usr/bin/br: error: [Input/output error] ioctl

if you're not sure what user it's running as, try running "whoami" in
the crontab.  although if it's root's crontab it should definitely be
running as root.

I assume if you run this progam yourself it doesn't give that error.

Trying putting "strace -f br" or "ltrace -Sf br" instead of "br" in cron
and see what it's doing when it fails.  (you'll need the strace and
ltrace packages respectively)


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



Re: crontab uid ?

2004-12-20 Thread Kevin Coyner


On Sun, Dec 19, 2004 at 08:48:46PM -0800, Steve Lamb wrote..

> Kevin Coyner wrote:
> >Is root restricted when it comes to serial port commands?
> 
> It is if the commands are not in the path given to crontab and the
> command didn't have an explicit path.  IIRC crontab has a very
> limited path by default.  Gust a guess without more information
> What was the exact error that was thrown?


I was using the full path of the program (/usr/bin/br).

When I had it running in root's crontab, it threw the error:

   /usr/bin/br: error: [Input/output error] ioctl


Thanks,
Kevin


-- 
Kevin Coyner  GnuPG key: 1024D/8CE11941  http://rustybear.com/pubkey.php


signature.asc
Description: Digital signature


Re: crontab uid ?

2004-12-19 Thread Patrick Wiseman
On Sun, 19 Dec 2004 23:38:07 -0500, Kevin Coyner <[EMAIL PROTECTED]> wrote:
> 
> When I create a crontab and it runs, what uid/gid does it run with?
> 
> I presume it's the uid of the user that has the crontab.  But I've run
> into a situation recently where root wasn't able to run a program from its
> crontab that interacted with the serial port (bottlerocket was the
> program).

Try running with the full path to the program.  cron runs in a very
limited environment, I think.

Patrick


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



Re: crontab uid ?

2004-12-19 Thread Steve Lamb
Kevin Coyner wrote:
Is root restricted when it comes to serial port commands?
It is if the commands are not in the path given to crontab and the 
command didn't have an explicit path.  IIRC crontab has a very limited path by 
default.  Gust a guess without more information  What was the exact error that 
was thrown?

--
 Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
   PGP Key: 8B6E99C5   | main connection to the switchboard of souls.
---+-


signature.asc
Description: OpenPGP digital signature


Re: Crontab Question

2004-07-16 Thread Ryan Waye
On Fri, Jul 16, 2004 at 05:16:08PM -0400 or thereabouts, Nori Heikkinen wrote:
> on Fri, 16 Jul 2004 04:44:59PM -0400, Ryan Waye insinuated:
> > Hello:
> > I have been having crontab report my exit statuses of backups
> > for some time now(they were the only thing there).  But now that
> > I have getmail on the crontab, this is quickly flooding my
> > mailbox.  It has been a while, and I can't remember how I made
> > cron do this.  How do I reverse this setting?
> 
> you mean, you want to stop the cron job?  or just stop getting
> notified that it's doing its thing?
> 
> to stop it:
> 
> crontab -e
> 
> and remove the appropriate line.
> 
> to stop getting notified about it:
> 
> crontab -e
> 
> and put a '&>/dev/null' (no quotes) at the end of the line, so that
> its output goes to the trash, and not to your inbox.
> 
> hth,
> 
> 
Thanks alot, that worked.

Ryan Waye












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



Re: Crontab Question

2004-07-16 Thread Nori Heikkinen
on Fri, 16 Jul 2004 04:44:59PM -0400, Ryan Waye insinuated:
> Hello:
>   I have been having crontab report my exit statuses of backups
> for some time now(they were the only thing there).  But now that
> I have getmail on the crontab, this is quickly flooding my
> mailbox.  It has been a while, and I can't remember how I made
> cron do this.  How do I reverse this setting?

you mean, you want to stop the cron job?  or just stop getting
notified that it's doing its thing?

to stop it:

crontab -e

and remove the appropriate line.

to stop getting notified about it:

crontab -e

and put a '&>/dev/null' (no quotes) at the end of the line, so that
its output goes to the trash, and not to your inbox.

hth,



-- 
.~.  nori @ sccs.swarthmore.edu
/V\  http://www.sccs.swarthmore.edu/~nori
   // \\  @ maenad.net
  /(   )\   www.maenad.net/jnl
   ^`~'^
  
++ Sponsor me as I run my SECOND marathon for AIDS:   ++
++ http://www.aidsmarathon.com/participant.asp?runner=DC-2844 ++


pgp01O2J2ytsr.pgp
Description: PGP signature


Re: Crontab last days of the month..

2004-04-14 Thread Dave Sherohman
On Wed, Apr 14, 2004 at 01:35:13PM -0400, Rick Pasotto wrote:
> if [ $(date -d tomorrow '+%m') -ne $(date '+%m') ]
> then
>   echo 'today is the last day of the month'
> fi

[ $(date -d tomorrow '+%d') -eq 1 ] && echo 'last of the month'

This can also be done directly in your crontab:

[ $(date -d tomorrow '+%d') -eq 1 ] && /path/to/executable

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)


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



Re: Crontab last days of the month..

2004-04-14 Thread N. Thomas
* s. keeling <[EMAIL PROTECTED]> [2004-04-14 09:58:38 -0600]:
> Another way is to run it every day, but have the script figure out if
> it's the last day of the month, and exit if not.

Or even better: run it on the 28th-31st day of each calendar month and
then have the script figure out if it's the last day. (Days 1-27 will
never be last day of the month.)

But, depending on what the OP needed it for, a minute or two after the
midnight on the first of the month might also work.

Thomas

-- 
N. Thomas
[EMAIL PROTECTED]
Etiamsi occiderit me, in ipso sperabo


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



Re: Crontab last days of the month..

2004-04-14 Thread Rick Pasotto
On Wed, Apr 14, 2004 at 09:58:38AM -0600, s. keeling wrote:
> Incoming from Wayne Topa:
> > Rus Foster([EMAIL PROTECTED]) is reported to have said:
> > > Hi All,
> > > Couldn't find a decent answer to this in google but goes as follows
> > > 
> > > If I have a cron job that is scheduled for the 31st of the month and the
> > > month we are in doesn't have 31 days would it be run on the last day of
> > > the month or not run at all?
> > 
> > I bzip up all my mail at the end of the month and had the same
> > problem.  I solved it by having the script run 1 minute after midnight
> > on the 1st of the month.
> 
> Another way is to run it every day, but have the script figure out if
> it's the last day of the month, and exit if not.  I have no idea where
> I found this, nor have I tested it extensively:
> 
> days_in_month () 
> { 
> dim_m=${1:-`date +%m`};
> dim_m=`monthnum $dim_m`;
> case ${dim_m#0} in 
> 9 | 4 | 6 | 11)
> echo 30
> ;;
> 1 | 3 | 5 | 7 | 8 | 10 | 12)
> echo 31
> ;;
> 2)
> is_leap_year ${2:-`date +%Y`} && echo 29 || echo 28
> ;;
> esac
> }

if [ $(date -d tomorrow '+%m') -ne $(date '+%m') ]
then
echo 'today is the last day of the month'
fi


-- 
"Without private property, there is no meaningful economic
 calculation, and without meaningful economic calculation,
 there is only economic chaos." -- William Anderson
Rick Pasotto[EMAIL PROTECTED]http://www.niof.net


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



Re: Crontab last days of the month..

2004-04-14 Thread s. keeling
Incoming from Wayne Topa:
> Rus Foster([EMAIL PROTECTED]) is reported to have said:
> > Hi All,
> > Couldn't find a decent answer to this in google but goes as follows
> > 
> > If I have a cron job that is scheduled for the 31st of the month and the
> > month we are in doesn't have 31 days would it be run on the last day of
> > the month or not run at all?
> 
> I bzip up all my mail at the end of the month and had the same
> problem.  I solved it by having the script run 1 minute after midnight
> on the 1st of the month.

Another way is to run it every day, but have the script figure out if
it's the last day of the month, and exit if not.  I have no idea where
I found this, nor have I tested it extensively:

days_in_month () 
{ 
dim_m=${1:-`date +%m`};
dim_m=`monthnum $dim_m`;
case ${dim_m#0} in 
9 | 4 | 6 | 11)
echo 30
;;
1 | 3 | 5 | 7 | 8 | 10 | 12)
echo 31
;;
2)
is_leap_year ${2:-`date +%Y`} && echo 29 || echo 28
;;
esac
}


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*)   http://www.spots.ab.ca/~keeling 
- -


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



Re: Crontab last days of the month..

2004-04-14 Thread Wayne Topa
Rus Foster([EMAIL PROTECTED]) is reported to have said:
> Hi All,
> Couldn't find a decent answer to this in google but goes as follows
> 
> If I have a cron job that is scheduled for the 31st of the month and the
> month we are in doesn't have 31 days would it be run on the last day of
> the month or not run at all?

I bzip up all my mail at the end of the month and had the same
problem.  I solved it by having the script run 1 minute after midnight
on the 1st of the month.

:-) HTH, YMMV, HAND :-)
Wayne

-- 
Hit any user to continue.
___


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



Re: crontab and command expansion problem

2004-04-12 Thread D. Clarke
Isaac Claymore wrote:

WEEK_DAY=`date +\%A`
30 23 * * * mount /backup && mysqldump --password=FOOBAR --all-databases > 
/backup/alldb-${WEEK_DAY}.sql; umount /backup
It's been working on RH system, but the Debian cron keeps refusing to do command
expansion on WEEK_DAY, i.e. the script produces a file named: alldb-`date +\%A`.sql
Any hint?
 

A little on the simple-minded side, but have you considered just not
using the variable?  I have a cron job that does
12 4 * * 2 /some/script | mail -s "Info for `date +'\%B \%-d, \%Y'`" [EMAIL PROTECTED]

and it has never given me any trouble.
   

Thanks, but I've got multiple crontab entries that use `date +\%A`, so it looks
better to me to assign it to a variable.
 

I would probably take your backup sequence and make a script in /etc/cron.daily

It would give you much more flexability for what you want to do.

~ Darryl

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



Re: crontab and command expansion problem

2004-04-12 Thread Isaac Claymore
On Mon, Apr 12, 2004 at 09:57:18AM -0500, Dave Sherohman wrote:
> On Wed, Apr 07, 2004 at 10:34:06AM +0800, Isaac Claymore wrote:
> > WEEK_DAY=`date +\%A`
> > 30 23 * * * mount /backup && mysqldump --password=FOOBAR --all-databases > 
> > /backup/alldb-${WEEK_DAY}.sql; umount /backup
> > 
> > It's been working on RH system, but the Debian cron keeps refusing to do command
> > expansion on WEEK_DAY, i.e. the script produces a file named: alldb-`date +\%A`.sql
> > 
> > Any hint?
> 
> A little on the simple-minded side, but have you considered just not
> using the variable?  I have a cron job that does
> 
> 12 4 * * 2 /some/script | mail -s "Info for `date +'\%B \%-d, \%Y'`" [EMAIL 
> PROTECTED]
> 
> and it has never given me any trouble.

Thanks, but I've got multiple crontab entries that use `date +\%A`, so it looks
better to me to assign it to a variable.

> 
> -- 
> The freedoms that we enjoy presently are the most important victories of the
> White Hats over the past several millennia, and it is vitally important that
> we don't give them up now, only because we are frightened.
>   - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)

-- 

Regards, Isaac
()  ascii ribbon campaign - against html e-mail
/\- against microsoft attachments


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



Re: crontab and command expansion problem

2004-04-12 Thread Dave Sherohman
On Wed, Apr 07, 2004 at 10:34:06AM +0800, Isaac Claymore wrote:
> WEEK_DAY=`date +\%A`
> 30 23 * * * mount /backup && mysqldump --password=FOOBAR --all-databases > 
> /backup/alldb-${WEEK_DAY}.sql; umount /backup
> 
> It's been working on RH system, but the Debian cron keeps refusing to do command
> expansion on WEEK_DAY, i.e. the script produces a file named: alldb-`date +\%A`.sql
> 
> Any hint?

A little on the simple-minded side, but have you considered just not
using the variable?  I have a cron job that does

12 4 * * 2 /some/script | mail -s "Info for `date +'\%B \%-d, \%Y'`" [EMAIL PROTECTED]

and it has never given me any trouble.

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)


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



Re: crontab jobs not running?

2004-03-20 Thread Nitebirdz
On Fri, Mar 19, 2004 at 07:17:22AM +, Alan Chandler wrote:
> 
> Just a thought - do you have anacron installed.  Its a while since I have, 
> but I have this feeling that it simulates the running of cron and therefore 
> its the times in /etc/anacrontab that matter
> 

No, anacron is not installed.  In any case, the reboot appeared to clear the
problem, at least when it comes to the use of 'crontab -e'.  Once I got that
working, I didn't bother to check again and see if perhaps "/etc/crontab"
still has the problem with the timezones.  

Many thanks to everyone who provided assistance, especially Martin Dickopp
who sent a few emails back and forth.  


Nitebirdz
http://www.sacredchaos.com/


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



Re: crontab jobs not running?

2004-03-18 Thread Alan Chandler
On Tuesday 16 March 2004 15:30, Nitebirdz wrote:
> On Tue, Mar 16, 2004 at 10:59:18AM +0100, Andreas Janssen wrote:
> > IIRC, if you edit user crontabs, you have to leave away the user field.
> > The jobs will be run under the ID the crontab belongs to. If you use
> > vixie cron, the user field is only needed in /etc/crontab and
> > /etc/cron.d crontab segments.
>
> I'm sorry.  You're right, and that's the way I was using it.  I originally
> entered the information *without* the username, but then I decided to try
> using the "/etc/crontab" file instead where one needs to enter the
> username. When I copied and pasted the contents of the file, I used the
> latter.
>
> So, here is the latest on this issue:
>
> o If I add the entries I mentioned previously (*without* the usernames) via
>   'crontab -e', the jobs never get executed.
>
> o If I add them to the "/etc/crontab" file, they do get executed but at
> very different hours than the ones I specify.  For instance, the
> 'mkreport.deb' script runs at 7:00 PM for some reason.
>
> o Yes, the system time appears to be correct whenever I run the 'date'
> command.
>
>
> Any suggestions?

Just a thought - do you have anacron installed.  Its a while since I have, but 
I have this feeling that it simulates the running of cron and therefore its 
the times in /etc/anacrontab that matter

-- 
Alan Chandler
[EMAIL PROTECTED]
First they ignore you, then they laugh at you,
 then they fight you, then you win. --Gandhi


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



Re: crontab jobs not running?

2004-03-18 Thread Cameron Hutchison
Once upon a time Nitebirdz said...
> 
> These are the lines I added to the "/etc/crontab" file:
> 
> * * * * * root /bin/date > /tmp/date_crontab
> * * * * * root /bin/date -u > /tmp/date2_crontab
> 
> The output was, in that order:
> 
> Thu Mar 18 20:59:01 CST 2004
> Fri Mar 19 02:59:01 UTC 2004
> 
> It looks fine to me.  I suppose I should go ahead and reboot the darn thing, 
> just to see if this clears up.  I just cannot find any rational explanation
> to this behavior.  Sure, this is not Windows.  Still, let's see.

To me, it looks like cron is not running with your timezone, but your
user processes are.

If you had TZ=CST in your user's .profile and nothing in /etc/timezone,
then I'd expect you'd see the behaviour you are seeing (given your
previously posted syslog entries).

The funny thing is that none of the cron manpages mention anything about
timezones or local time, but for it to work intuitively, the crontab
would have to be read as though the times are all in local time. But if
you have a multi-user system with users spread out across timezones, and
the users each manually set TZ in their .profile, cron will still run
the users' crontabs according to the system default timezone.

Ideally, a crontab should be able to specify a timezone that the
timespec is relative to.

Or, your problem may have nothing to do with timezones. I just have them
on the brain from dealing with similar issues at work :-)


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



Re: crontab jobs not running?

2004-03-18 Thread Nitebirdz
On Thu, Mar 18, 2004 at 10:16:29PM +0100, Martin Dickopp wrote:
> 
> What happens if you specify `* * * * *' (i.e. every minute) as time
> specification?
> 

Well, now that seems to work.  I added that entry via 'crontab -e' and it
did work.  After that, I also tried some partial times, such as "41 * * * *" 
and then "43 20 * * *", and they both worked.  Once I did that, the same 
applies to entries such as "50 20 * * Thu".  The more I troubleshoot this, 
the more confused I am.

> 
> Does your clock run monotonically, or could it step (possibly because
> you run tools which synchronize it to some external reference time)?
>

No, I just checked and I'm not using 'ntp' or any such program to sync the
system time.
 
> If you run `date' and `date -u' from /etc/crontab, what do they show?
>

These are the lines I added to the "/etc/crontab" file:

* * * * * root /bin/date > /tmp/date_crontab
* * * * * root /bin/date -u > /tmp/date2_crontab

The output was, in that order:

Thu Mar 18 20:59:01 CST 2004
Fri Mar 19 02:59:01 UTC 2004

It looks fine to me.  I suppose I should go ahead and reboot the darn thing, 
just to see if this clears up.  I just cannot find any rational explanation
to this behavior.  Sure, this is not Windows.  Still, let's see.


Nitebirdz
http://www.sacredchaos.com/


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



Re: crontab jobs not running?

2004-03-18 Thread Martin Dickopp
Nitebirdz <[EMAIL PROTECTED]> writes:

> I just did this by su'ing as user "jortega" and running 'crontab -e' to
> enter the following lines:
>
> 35 20 * * * /bin/echo "testing" > /tmp/testing
> 35 20 * * * /bin/date > /tmp/time

What happens if you specify `* * * * *' (i.e. every minute) as time
specification?

> This correctly created the file under "/var/spool/cron/crontabs", and it
> also appears to have the correct ownership and permissions.
>
> # ls -l /var/spool/cron/crontabs/
> total 8
> -rw---1 root jortega   278 Mar 17 20:31 jortega
^
> -rw---1 root root  243 Mar 15 18:55 root
>
> Yet, it failed to run at the specified time.  However, I found something
> quite interesting in the "/var/log/syslog" file:
>
> Mar 17 20:40:23 milan crontab[17372]: (jortega) REPLACE (jortega)
> Mar 17 20:40:23 milan crontab[17372]: (jortega) END EDIT (jortega)
 
> Mar 18 02:41:01 milan /usr/sbin/cron[193]: (jortega) RELOAD (crontabs/jortega)

I find the discrepancy between the underlined timestamps very strange.

Does your clock run monotonically, or could it step (possibly because
you run tools which synchronize it to some external reference time)?

If you run `date' and `date -u' from /etc/crontab, what do they show?

Martin


-- 
   ,--.Martin Dickopp, Dresden, Germany ,= ,-_-. =.
  / ,- )   http://www.zero-based.org/  ((_/)o o(\_))
  \ `-' `-'(. .)`-'
   `-. Debian, a variant of the GNU operating system.   \_/


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



Re: crontab jobs not running?

2004-03-17 Thread Nitebirdz
On Tue, Mar 16, 2004 at 06:37:48PM +0100, Martin Dickopp wrote:
> 
> - Could it be that you have accidentally embedded an invisible control
>   character in the file?
>

I just checked by doing a ":set list" from within 'vi', and everything
looked normla.
 
> - Is there a newline character after the last line?
> 

Yes.  

> - While you test `crontab -e', don't specify the next minute as time,
>   but one minute after the next (i.e. two minutes after the current
>   time). `cron' re-reads its crontabs once a minute, but only executes
>   newly found jobs in the /next/ minute.
> 
> BTW, does `crontab -e' work for users other than root?
> 

I just did this by su'ing as user "jortega" and running 'crontab -e' to
enter the following lines:

35 20 * * * /bin/echo "testing" > /tmp/testing
35 20 * * * /bin/date > /tmp/time

This correctly created the file under "/var/spool/cron/crontabs", and it
also appears to have the correct ownership and permissions.

# ls -l /var/spool/cron/crontabs/
total 8
-rw---1 root jortega   278 Mar 17 20:31 jortega
-rw---1 root root  243 Mar 15 18:55 root

Yet, it failed to run at the specified time.  However, I found something
quite interesting in the "/var/log/syslog" file:

Mar 17 20:40:23 milan crontab[17372]: (jortega) REPLACE (jortega)
Mar 17 20:40:23 milan crontab[17372]: (jortega) END EDIT (jortega)
Mar 18 02:41:01 milan /usr/sbin/cron[193]: (jortega) RELOAD (crontabs/jortega)

I'm not sure I understand this.  So, I make a change to the crontab via
'crontab -e', and when I finish editing the file and save it, the logs
display two entries from a 'crontab' process (PID 17372) replacing and
editing the file, which makes sense.  But what is going on with that other
entry with *tomorrow's* timestamp and a very wacky time?  Where is the
'/usr/sbin/cron' command getting that system time from?  Just in case,
sending the killhup signal to the process didn't seem to help either.



Nitebirdz
http://www.sacredchaos.com/


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



Re: crontab jobs not running?

2004-03-16 Thread Martin Dickopp
Nitebirdz <[EMAIL PROTECTED]> writes:

> On Tue, Mar 16, 2004 at 04:56:05PM +0100, Martin Dickopp wrote:
>> 
>> You want to run `mkreport.deb' at 1:00am, and if the timezone in your
>> email header is correct, you appear to be 6 hours western of GMT. This
>> means that it is 1:00am GMT when it is 7:00pm of your local time. Therefore,
>> presumably something is wrong with your timezone configuration.
>> 
>> - Is the environment variable `TZ' set? If so, to what? Is it already
>>   set when cron is started?
>> - What's the content of /etc/timezone?
>> - What does /etc/localtime (a symlink) point to?
>> 
>> You might need to run `tzconfig'.
>
> Thanks, Martin.  Here is the information you are requesting.  It all appears
> to be fine, except perhaps for the $TZ variable.  Could that be causing the
> problem?

I don't think so; not setting TZ is fine. My thought was that if you set
TZ in a shell login script, it would be set in the shell where you ran
the `date' command, but not in the init script which starts `cron'. This
would have explained why `cron' and the shell use different timezones.
However, if TZ is /not/ set in the shell, the problem must be something
else.

> I will try running 'tzconfig' again, but that still doesn't explain
> why 'crontab -e' doesn't appear to be working at all, right?

Right. I have no idea why it doesn't.

Thinking about it, I have three ideas what you could check:

- Could it be that you have accidentally embedded an invisible control
  character in the file?

- Is there a newline character after the last line?

- While you test `crontab -e', don't specify the next minute as time,
  but one minute after the next (i.e. two minutes after the current
  time). `cron' re-reads its crontabs once a minute, but only executes
  newly found jobs in the /next/ minute.

BTW, does `crontab -e' work for users other than root?

> milan:~# echo $TZ
>
> milan:~# more /etc/timezone
> US/Central
>
> milan:~# ls -l /etc/localtime
> lrwxrwxrwx1 root root   30 Mar  7 17:14 /etc/localtime -> 
> /usr/share/zoneinfo/US/Central

That looks fine to me.

You already said that `date' shows the correct time. Does the command
`date -u' show the correct GMT time (i.e. six hours ahead of your local
time)?

If you run `date' and `date -u' as cron jobs, do they also show the
correct times?

Martin


-- 
   ,--.Martin Dickopp, Dresden, Germany ,= ,-_-. =.
  / ,- )   http://www.zero-based.org/  ((_/)o o(\_))
  \ `-' `-'(. .)`-'
   `-. Debian, a variant of the GNU operating system.   \_/


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



Re: crontab jobs not running?

2004-03-16 Thread Nitebirdz
On Tue, Mar 16, 2004 at 04:56:05PM +0100, Martin Dickopp wrote:
> 
> You want to run `mkreport.deb' at 1:00am, and if the timezone in your
> email header is correct, you appear to be 6 hours western of GMT. This
> means that it is 1:00am GMT when it is 7:00pm of your local time. Therefore,
> presumably something is wrong with your timezone configuration.
> 
> - Is the environment variable `TZ' set? If so, to what? Is it already
>   set when cron is started?
> - What's the content of /etc/timezone?
> - What does /etc/localtime (a symlink) point to?
> 
> You might need to run `tzconfig'.
> 

Thanks, Martin.  Here is the information you are requesting.  It all appears
to be fine, except perhaps for the $TZ variable.  Could that be causing the
problem?  I will try running 'tzconfig' again, but that still doesn't explain
why 'crontab -e' doesn't appear to be working at all, right?  

milan:~# echo $TZ

milan:~# more /etc/timezone
US/Central

milan:~# ls -l /etc/localtime
lrwxrwxrwx1 root root   30 Mar  7 17:14 /etc/localtime -> 
/usr/share/zoneinfo/US/Central



Nitebirdz
http://www.sacredchaos.com/


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



  1   2   3   >