LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2008, 09:38 AM   #1
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Rep: Reputation: 15
Question run a command as a user on boot up and others


ok i have opensuse 10.2 on my linux box now, but have a small problem

i use sabnzbd plus
i want to make the computer shutdown at 16:00 and boot back up at 22:00 on boot up i need it to load sabnzbd plus

now on ubuntu i added a cron command for shutdown 1600 -now ( i think ) that did the shut down bit and set the bios to wake up at 2200 (which did not work, if i shut down the pc using the menu and wait then wake on bios did work so shutdown command (though untested on opensuse) may not be the best root to go (or i may need one of linuxs 1 million and one confusing command switches after it to soft power off or something) )

but heres the kicker through a though search i found i could add into boot.local the command to load up sabnzbd ( python \home\mrgreaper\sabnzbd\sabnzbd.py -d ) but if i reboot the pc it loads sabnzbd but all the settings get blanked and the locations are wrong, if i restart the pc and type the same cd to the folder type python sabnzbd.py -d and hit enter it works perfectly so im guessing that in the startup boot.local its being run as root, i need it run as mrgreaper and preferably directly from the folder

or better yet,
is there a way to do a macro that trigers as the last thing when the desktop loads that would open a terminal and enter the following commands into it (just as if it was me at the computer)
cd sabnzbd
python sabnzbd.py -d

the -d puts it into a daemon mode but isnt required

the sabnzbd people are stumped im hoping you guys are not lol
 
Old 04-15-2008, 12:41 PM   #2
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
try addding the command to the users .basrc
 
Old 06-24-2008, 09:52 AM   #3
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dasy2k1 View Post
try addding the command to the users .basrc
added it to the .bashrc file (i assume thats the one you ment)

now testing (comp decided to force a disk check so it will be a while before i will know if it works or not)

reason for late reply is i have been running it 24/7 but now need to change that

i need it to shutdown at 1000 and reboot at 2100 everyday

noww before i rebooted i tried the ubuntu command "shutdown" but its an unregonized command in suse

so how do i tell the computer to shutdown at 1000 ?
renember im very very inexperienced (took me 2 hours to find .bashrc) so please explain step by step, please.
im going to set the bios to wake up at a certain time but it occurres to me a better way maybe to have the computer hibernate at 1000 and wake up at 2100 (is that possible? im thinking it would use very little power during that time and give the hardware time to rest)
 
Old 06-24-2008, 10:01 AM   #4
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
yes the .bashrc is the file i ment, just a typo...

on suse the shutdown command is located in /sbin which is only acsessable by default to root

to run the shutdown command you need to have root privaliges
 
Old 06-24-2008, 10:10 AM   #5
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dasy2k1 View Post
yes the .bashrc is the file i ment, just a typo...

on suse the shutdown command is located in /sbin which is only acsessable by default to root

to run the shutdown command you need to have root privaliges
how do i do that ? (would be nice to put in a command in the bashrc to shutdown at 1000)

.bashrc
ok it sort of worked

on the headless box im now looking at a gray screen and a mouse pointer

however sabnzbd is loaded and available to my other pc`s

not sure where to go from here as i cant access the desktop
 
Old 06-25-2008, 09:14 AM   #6
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
bumping wouldnt normaly but as i say above my linux box only loads to a gray screen with a mouse pointer, thats quite criticle to fix
 
Old 06-25-2008, 07:31 PM   #7
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
really really really need help as i say i got no desktop but the comp is loading theres got to be something i can do to fix this???a button to hold down or something?
 
Old 07-25-2008, 10:34 AM   #8
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
a reformat fixed it
 
  


Reply

Tags
macro, opensuse, shutdown



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run command as normal user at boot time julot Slackware 2 01-28-2007 10:27 AM
run a command as another user!! mike81 Linux - Newbie 7 08-02-2006 12:58 PM
run command as user BFEINZIMER Linux - Newbie 9 08-24-2005 10:21 PM
run mount command as user paul_mat Linux - Newbie 1 12-14-2004 06:28 PM
How to run a command on new mail for a user? pembo13 Linux - Networking 0 09-26-2004 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration