Solved

cron job to "self restart server"

Posted on 2009-05-04
9
958 Views
Last Modified: 2013-12-16
Greetings experts,

I am not familiar with Linux, and think this is a pretty easy question for someone who is familiar.

I have this cron job running: /sbin/shutdown -r now
59 23 1 * *

I get this email notification error:
shutdown: you must be root to do that!

How do I resolve this?
0
Comment
Question by:pzozulka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 250 total points
ID: 24296097
Hi prozulka,

The job must re run as root.  Either enter the job into cron as the root user, or use sudo to have the job become root.


Good Luck,
Kent
0
 
LVL 16

Assisted Solution

by:ai_ja_nai
ai_ja_nai earned 250 total points
ID: 24296306
or use setuid, as root, to allow normal users to perform that command
0
 
LVL 8

Author Comment

by:pzozulka
ID: 24296646
It makes sense to log in as root and do this, but I am setting up the job in PLESK. Do I have any control over any of these suggestions from PLESK?
0
Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24296719
If you have enabled root access you can login to your Plesk ControlPanel using the username root and the password you created
http://kb.mediatemple.net/questions/923/Using+root+login+with+Plesk
0
 
LVL 8

Author Comment

by:pzozulka
ID: 24296750
I only have the default ADMIN password that comes with the dedicated Virtual Machine at GoDaddy. When I use "/sbin/shutdown -r now" am I emplying to shutdown the entire server itself, maybe that is why its not allowing me to do that?

I'm trying to restart only the virtual machine that we have. I guess I don't have root password, only the Admin default login.
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24296920
Isn't PLESK a virtualized host? You should be jailed inside a VM, so that you can mess around as much as you want.. or am I wrong?
0
 
LVL 8

Author Comment

by:pzozulka
ID: 24297597
It is indeed. It is a virtual control panel. Also, the owner of that cron job has full permissions setup in Plesk.
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24297683
I don't understand. Within a vm you should have the freedom of rebooting it, am I wrong?
0
 
LVL 8

Author Comment

by:pzozulka
ID: 24297961
Yeah I should be. I guess I don't have the permissions to on that account. Is there a line I could insert after the CRON similar as the Windows RUN AS?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question