Page 2 of 2

Re: Shutdown host system ?

Posted: October 22nd, 2012, 12:09 pm
by sander
Why now the different time?

Re: Shutdown host system ?

Posted: October 22nd, 2012, 1:18 pm
by Sinisa
got it :) i think

I can make sh script with

Code: Select all

#!/bin/bash
echo my_awesome_password | sudo -S python awesome_script.py
and put that in crontab, will tet it latter

to replay to you:

It is just a test enter. i would change it later to

10 0 * * *

Re: Shutdown host system ?

Posted: October 22nd, 2012, 1:32 pm
by sander
Can you post the contents of the scripts?

Does

sudo crontab -e

0 * * * * shutdown -h

work?

Re: Shutdown host system ?

Posted: October 22nd, 2012, 2:29 pm
by Sinisa
will check that and clean out code,

there are some leftovers there.

will check in tomorow, gotta run now.


thanks!

Re: Shutdown host system ?

Posted: October 22nd, 2012, 4:10 pm
by Sinisa
this is first run, i rebooted system after this
- don't know is it important

Code: Select all

Oct 22 22:17:01 Xbmc CRON[6012]: (root) CMD (   cd / && run-parts --report /etc/                              cron.hourly)
Oct 22 23:00:01 Xbmc CRON[7507]: (root) CMD (shutdown -h)
Oct 22 23:00:01 Xbmc CRON[7506]: (CRON) error (grandchild #7507 failed with exit                               status 127)
Oct 22 23:00:01 Xbmc CRON[7506]: (root) MAIL (mailed 1 byte of output; but got s                              tatus 0x004b, #012)
Oct 22 23:04:08 Xbmc cron[992]: (CRON) INFO (pidfile fd = 3)
Oct 22 23:04:08 Xbmc cron[1022]: (CRON) STARTUP (fork ok)
Oct 22 23:04:08 Xbmc cron[1022]: (CRON) INFO (Running @reboot jobs)

Re: Shutdown host system ?

Posted: October 22nd, 2012, 4:13 pm
by sander
This is getting very non-SABnzbd. Probably better to ask in a more specialized forum.

Re: Shutdown host system ?

Posted: October 23rd, 2012, 1:03 am
by Sinisa
sander thank you for all your help,

I'll do some more testing today, if script is going to work via sh script it is ok with me.

Regards, Sinisa

[solved] Shutdown host system ?

Posted: October 25th, 2012, 1:02 am
by Sinisa
Ok just for reference if somebody needs this.

This definitely works, calling py script with this sh script is solution.

Code: Select all

#!/bin/bash
echo my_awesome_password | sudo -S python awesome_script.py
Sander, thank you for all your help :)