Solved

cron job to "self restart server"

Posted on 2009-05-04
9
940 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

808 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