Solved

cron job to "self restart server"

Posted on 2009-05-04
9
932 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:
Kdo 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
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.

770 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