VectorLinux
December 21, 2014, 12:27:53 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: 1 [2]
  Print  
Author Topic: how do I autoshutdown with cron  (Read 7440 times)
startreksteve
Member
*
Posts: 13


« Reply #15 on: May 02, 2008, 02:13:43 am »

Sorry, I meant the scheduled task (shutdown) doesnt run.
it just sits there still logged on.
which runlevel cron service should be enabled? I started them all.
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
startreksteve
Member
*
Posts: 13


« Reply #16 on: May 20, 2008, 01:24:30 am »

Still no scheduling working...
What services do I need to check are working? Ive a feeling the cron service isnt running, how can I quickly check that it is?
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
bigpaws
Vectorian
****
Posts: 1862


« Reply #17 on: May 20, 2008, 04:22:05 am »

In the Cli type

ps aux | grep cron

Bigpaws
Logged
startreksteve
Member
*
Posts: 13


« Reply #18 on: May 20, 2008, 10:01:44 am »

In the Cli type

ps aux | grep cron

Bigpaws

Ok tried that and got the response:

steve:$ ps aux | grep cron
root      2645  0.0  0.2   1868   680 ?        S    16:37   0:00 /usr/sbin/crond
steve     3160  0.0  0.2   2008   640 pts/0    R+   18:57   0:00 grep cron

Does that look as though as it should work?
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
saulgoode
Vectorite
***
Posts: 340



« Reply #19 on: May 20, 2008, 06:14:49 pm »

Ok I tried editing /var/spool/cron/crontabs/root and /var/spool/cron/crontabs/steve with nano, and created the following entry:
30 18 * * 1-7 /sbin/shutdown -h
saved it ok, checked the cron and its in the list.
I enabled the cron service, and nothing runs.
Any ideas?

You need to instruct the shutdown command when it should shutdown:

30 18 * * 1-7 /sbin/shutdown -h now


Actually, you might want to provide a bit of warning, rather than shutting down without notice.
Logged

A complex system that works is invariably found to have evolved from a simple system that works.
startreksteve
Member
*
Posts: 13


« Reply #20 on: May 20, 2008, 10:49:27 pm »

Ok I tried editing /var/spool/cron/crontabs/root and /var/spool/cron/crontabs/steve with nano, and created the following entry:
30 18 * * 1-7 /sbin/shutdown -h
saved it ok, checked the cron and its in the list.
I enabled the cron service, and nothing runs.
Any ideas?

You need to instruct the shutdown command when it should shutdown:

30 18 * * 1-7 /sbin/shutdown -h now


Actually, you might want to provide a bit of warning, rather than shutting down without notice.

Thats not the point...
I tried BOTH, and neither work...
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
bigpaws
Vectorian
****
Posts: 1862


« Reply #21 on: May 21, 2008, 03:25:33 am »

Check this file /var/spool/cron/crontabs/steve to make sure that
the shutdone command is not there. If it is move it to /var/spool/cron/
crontabs/root. Since only root can issue that command. You may
also want to check the logs for any entries. The other thing maybe to
check you syntax by issuing a command to execute that you
know you are allowed to. For example set time then /usr/bin/touch mytime.

That should create the file mytime in the home directory. If that works then
the path to shutdown is incorrect or the permissions are incorrect.

HTH

Bigpaws
Logged
startreksteve
Member
*
Posts: 13


« Reply #22 on: May 21, 2008, 12:26:23 pm »

Ok I tried editing /var/spool/cron/crontabs/root and /var/spool/cron/crontabs/steve with nano, and created the following entry:
30 18 * * 1-7 /sbin/shutdown -h
saved it ok, checked the cron and its in the list.
I enabled the cron service, and nothing runs.
Any ideas?

You need to instruct the shutdown command when it should shutdown:

30 18 * * 1-7 /sbin/shutdown -h now


Actually, you might want to provide a bit of warning, rather than shutting down without notice.

Thats not the point...
I tried BOTH, and neither work...
Steve

Ive done it!
One bloody character!!
it SHOULD read:
30 17,18,19 * * * /sbin/shutdown -h now
NOT:
30 18 * * 1-7 /sbin/shutdown -h now

It was the 1-7 that confused it,
every day should be * not 1-7.
hurray! took me a few weeks to crack it eh?
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
startreksteve
Member
*
Posts: 13


« Reply #23 on: May 25, 2008, 05:42:10 am »

Ok I tried editing /var/spool/cron/crontabs/root and /var/spool/cron/crontabs/steve with nano, and created the following entry:
30 18 * * 1-7 /sbin/shutdown -h
saved it ok, checked the cron and its in the list.
I enabled the cron service, and nothing runs.
Any ideas?

You need to instruct the shutdown command when it should shutdown:

30 18 * * 1-7 /sbin/shutdown -h now


Actually, you might want to provide a bit of warning, rather than shutting down without notice.

Thats not the point...
I tried BOTH, and neither work...
Steve

Ive done it!
One bloody character!!
it SHOULD read:
30 17,18,19 * * * /sbin/shutdown -h now
NOT:
30 18 * * 1-7 /sbin/shutdown -h now

It was the 1-7 that confused it,
every day should be * not 1-7.
hurray! took me a few weeks to crack it eh?
Steve

After all that effort... guess what? the day after I figured out the cron problem,
A machine was getting thrown in the trash at work... a perfectly functional AMD Athlon XP 2000, I said if its being dumped, Ill have it,
my three year old now has a 1.7mhz cpu running Ubuntu Hardy, Ive never needed to use the cron in Vector!
(anyone want a Celeron 400?)

I cant believe we are throwing away a 1.7mhz pc as being too slow!!!
that is of course because it was running XP.
flys on Linux, but hey, we all know that!
Steve
Logged

Celeron 700 Laptop 256mb running Vector 5.9
3 year-old Sons' Celeron 400 320mb 20GB HD running Vector 5.9
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!