Shutdown host system ?

Feel free to talk about anything and everything in this board.
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Shutdown host system ?

Post by sander »

Why now the different time?
Sinisa
Newbie
Newbie
Posts: 32
Joined: June 3rd, 2012, 10:18 am

Re: Shutdown host system ?

Post 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 * * *
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Shutdown host system ?

Post by sander »

Can you post the contents of the scripts?

Does

sudo crontab -e

0 * * * * shutdown -h

work?
Sinisa
Newbie
Newbie
Posts: 32
Joined: June 3rd, 2012, 10:18 am

Re: Shutdown host system ?

Post by Sinisa »

will check that and clean out code,

there are some leftovers there.

will check in tomorow, gotta run now.


thanks!
Sinisa
Newbie
Newbie
Posts: 32
Joined: June 3rd, 2012, 10:18 am

Re: Shutdown host system ?

Post 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)
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Shutdown host system ?

Post by sander »

This is getting very non-SABnzbd. Probably better to ask in a more specialized forum.
Sinisa
Newbie
Newbie
Posts: 32
Joined: June 3rd, 2012, 10:18 am

Re: Shutdown host system ?

Post 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
Sinisa
Newbie
Newbie
Posts: 32
Joined: June 3rd, 2012, 10:18 am

[solved] Shutdown host system ?

Post 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 :)
Post Reply