Fedora Linux Support Community & Resources Center
  #1  
Old 5th July 2012, 08:17 PM
L3l00's Avatar
L3l00 Online
Registered User
 
Join Date: Oct 2011
Location: New Mexico
Age: 24
Posts: 88
linuxopera
Crontab newb issue

I apologize if i placed this in the wrong directory, could seriously use some help.

I am sort of new to "crontab" and trying my hardest to get it to work properly with Fedora 17 (64-bit).



(For privacy reasons I am using just he beginning letter for the user name)

this is what I am doing.


Code:
sudo env EDITOR=nano crontab -u j -e
Then I placed this in:

Code:
     0          17              *       *               *   /sbin/shutdown -h now
saved then exited, then did.

Code:
sudo service crond restart

this is not working....
Reply With Quote
  #2  
Old 5th July 2012, 08:31 PM
axel2078 Offline
Registered User
 
Join Date: Jun 2010
Location: Fairview Heights, IL
Posts: 74
windows_xp_2003firefox
Re: Crontab newb issue

I have no idea what the sudo command you entered does aside from setting your editor to nano. It looks like your crontab is scheduled to halt (not shutdown) your system every day at 5 pm. Is that what you intended to do? Who is the cron running under? I'm guessing that since you used sudo, it's still using your environment variables instead of root's. What I normally do when creating a new cron job is become root (su -) and then do crontab -e to do whatever I need. Remember that there is a difference between doing something as root and doing it via sudo.
Reply With Quote
  #3  
Old 5th July 2012, 08:39 PM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,449
linuxfirefox
Re: Crontab newb issue

Well, the immediate problem I see is that the crontab is being made for a user called "j" via the crontab -u option
if that "j" account can't run shutdown for halt then it's not going to work. Is there in fact a user account "j", try:
Quote:
id -a j
If there is a user 'j' then you'll see the user uid and group uid info for j

Why aren't you just having root do the shutdown?
Reply With Quote
  #4  
Old 5th July 2012, 08:58 PM
L3l00's Avatar
L3l00 Online
Registered User
 
Join Date: Oct 2011
Location: New Mexico
Age: 24
Posts: 88
linuxopera
Re: Crontab newb issue

hmmm okay

yes you are right for the first one the:
Code:
sudo env EDITOR=nano
opens crontab in nano instead of vi, vi is such a pain in my opinion.


so if i were to go under root (The "j" is an admin on the server) then type:

Code:
env EDITOR=nano crontab -e
It should open up the right way and take of the -h, I know h does halt previously I had it just "shutdown now."

But yes I would like to Server to just Shutdown completely at five.

This server has a Grub password loader, not much of an issue but would it be possible to have it turn itself on at a certain time, would I have to remove the grub password if I want it to just go automatically to the welcome screen?

---------- Post added at 01:45 PM ---------- Previous post was at 01:41 PM ----------

when I enter in
Code:
crontab -l
inside root, it lists the things I posted so it should be working.

---------- Post added at 01:58 PM ---------- Previous post was at 01:45 PM ----------

Code:
su -
then

Code:
env EDITOR=nano crontab -e
entered in the code:

Code:
0 15 * * * /sbin/shutdown now
then:

Code:
service crond restart


I tested this by putting in something similar to shutdown within three minutes, employees out to lunch so it was okay. Sure enough it clicked off. ^-^
Reply With Quote
Reply

Tags
crontab, newb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crontab Help tuldok89 Using Fedora 5 21st July 2011 09:09 PM
Crontab issue on Fedora 8 gizmobay Using Fedora 3 12th November 2007 03:42 AM
crontab: no changes made to crontab Bone Using Fedora 2 15th November 2006 02:56 PM
Linux newb. got himself in trouble. Booting\permissions issue on Primary HDD. Syncro Using Fedora 1 17th January 2006 03:15 AM


Current GMT-time: 03:14 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat