Re: need help on using crontab

2014-02-20 Thread Andrei POPESCU
On Jo, 20 feb 14, 07:56:38, Tom Furie wrote:
> On Wed, Feb 19, 2014 at 03:22:08AM -0500, Long Wind wrote:
> 
> > I find that shutdown can take a time argument
> > so why do I bother with cron
> > 
> > Thank Raffaele Morelli  and Tom anyway!
> 
> Cron would be useful if you want to regularly shutdown or reboot the
> machine on some definable interval without usually having to worry about
> it. If it's just a one time delayed shutdown, then yes, using the
> functionality built in to shutdown would be the better approach.

Assuming said command doesn't have such functionality 'at' would be the 
better tool anyway.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: need help on using crontab

2014-02-19 Thread Tom Furie
On Wed, Feb 19, 2014 at 03:22:08AM -0500, Long Wind wrote:

> I find that shutdown can take a time argument
> so why do I bother with cron
> 
> Thank Raffaele Morelli  and Tom anyway!

Cron would be useful if you want to regularly shutdown or reboot the
machine on some definable interval without usually having to worry about
it. If it's just a one time delayed shutdown, then yes, using the
functionality built in to shutdown would be the better approach.

Cheers,
Tom

-- 
A bachelor is an unaltared male.


signature.asc
Description: Digital signature


Re: need help on using crontab

2014-02-19 Thread Tom Furie
On Wed, Feb 19, 2014 at 08:20:50AM +, Dom wrote:

> From the original post, Long Wind seems to have used the original
> method of creating crontabs:
> 
> crontab 
> 
> The usual sequence (on the old Unix systems I used to admin) was:
> 
> crontab -l > mycronfile
> vi mycronfile (to edit)
> crontab mycronfile
> 
> crontab -e is much easier and safer to use.

That's the information I'm trying to get from him (I think Long Wind is
male, my apologies to you if you aren't).

'crontab -e' will create a crontab as the user, but crontabs created as
a normal user shouldn't have the user field populated. 'crontab -l' will
list the contents of the crontab created by 'crontab -e', so if the
crontab was created this way (with a username), it will look fine but
when cron tries to run the job it will look for a command that is the
username with the rest of the line as arguments.

If the intention is to run a cronjob as some system user the simplest
method is to create a file in /etc/cron.d, which would require the user
field to be populated.

Cheers,
Tom

-- 
BOFH excuse #221:

The mainframe needs to rest.  It's getting old, you know.


signature.asc
Description: Digital signature


Re: need help on using crontab

2014-02-19 Thread Long Wind
On 2/19/14, Raffaele Morelli  wrote:
>>
>
> ??
>
>
>
>
> First of all, is cron running?
> Have a `grep for CRON syslog`
>

I find that shutdown can take a time argument
so why do I bother with cron

Thank Raffaele Morelli  and Tom anyway!


-- 
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/CAB-gxZCzvGcM9CGqG=-ebryf4evfev9_2fxeomnxdkjjq2x...@mail.gmail.com



Re: need help on using crontab

2014-02-19 Thread Dom

On 19/02/14 07:13, Tom Furie wrote:

On Wed, Feb 19, 2014 at 12:56:50AM -0500, Long Wind wrote:


I want to shutdown at 5:03
I check with crontab -l
it seems OK


Depending on how you created the file the format may or may not be okay.
Did you create the file in /etc/cron.d, or as a user with 'crontab -e'?
Given that you say 'crontab -l' seems okay I suspect the latter.



From the original post, Long Wind seems to have used the original 
method of creating crontabs:


crontab 

The usual sequence (on the old Unix systems I used to admin) was:

crontab -l > mycronfile
vi mycronfile (to edit)
crontab mycronfile

crontab -e is much easier and safer to use.


--
Dom


--
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/53046962.4030...@rpdom.net



Re: need help on using crontab

2014-02-18 Thread Tom Furie
On Wed, Feb 19, 2014 at 12:56:50AM -0500, Long Wind wrote:

> I want to shutdown at 5:03
> I check with crontab -l
> it seems OK

Depending on how you created the file the format may or may not be okay.
Did you create the file in /etc/cron.d, or as a user with 'crontab -e'?
Given that you say 'crontab -l' seems okay I suspect the latter.

Cheers,
Tom

-- 
The meek shall inherit the earth -- they are too weak to refuse.


signature.asc
Description: Digital signature


Re: need help on using crontab

2014-02-18 Thread Raffaele Morelli
2014-02-19 6:26 GMT+01:00 Long Wind :

> I want to shutdown at some time,
> so I create a file named cmd with a line below:
>
> 3 5  * * * root /sbin/shutdown -h now
>
> I run the command : " crontab cmd"
>

??


>
> but it doesn't shutdown
> Why?


First of all, is cron running?
Have a `grep for CRON syslog`


Re: need help on using crontab

2014-02-18 Thread Long Wind
On 2/19/14, Tom Furie  wrote:
>
> Where did you create the file? Are you expecting the machine to shutdown
> when you invoke 'crontab cmd'?
>
> Cheers,
> Tom
>
> --

I want to shutdown at 5:03
I check with crontab -l
it seems OK


-- 
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/CAB-gxZCt=vLoU0ttd8mbwrnbHkExQYj7a3CmiTjk=euzh7o...@mail.gmail.com



Re: need help on using crontab

2014-02-18 Thread Tom Furie
On Wed, Feb 19, 2014 at 12:26:38AM -0500, Long Wind wrote:

> I want to shutdown at some time,
> so I create a file named cmd with a line below:
> 
> 3 5  * * * root /sbin/shutdown -h now
> 
> I run the command : " crontab cmd"
> 
> but it doesn't shutdown
> Why?

Where did you create the file? Are you expecting the machine to shutdown
when you invoke 'crontab cmd'?

Cheers,
Tom

-- 
Fakir, n:
A psychologist whose charismatic data have inspired almost
religious devotion in his followers, even though the sources
seem to have shinnied up a rope and vanished.


signature.asc
Description: Digital signature


need help on using crontab

2014-02-18 Thread Long Wind
I want to shutdown at some time,
so I create a file named cmd with a line below:

3 5  * * * root /sbin/shutdown -h now

I run the command : " crontab cmd"

but it doesn't shutdown
Why?


-- 
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/CAB-gxZB14p88A95PB18uOzOb=UsHRF3kf8Lv_z9gcr=qcul...@mail.gmail.com