Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
the first question is whether u are doing this as a 'user' or as a 'root'. if u r doing this as a 'root' u will not have any trouble. but as a 'user' do u have permissions to execute 'shutdown' and 'reboot'. if u do not have permissions, your crontab wouldn't work.
go to a console. type 'shutdown' and press enter. read what the result is.
i suspect what you need to be doing is 'sudo shutdown', whilst ubuntu has no concept of a root account, the linux software that you are trying to use *does* require root priveledges. after a quick fiddle on a local box, you can jink with sudo to not require a password from you, then use sudo shutdown in your cron. you should probably be able to tinker with cron and get a root or system crontab.
why are you wanting to turn the machine off anyways? i'm curious.
you will need "sudo shutdown -h", but check the manpage for anacron, because this little helper calls any jobs that weren't executed at the scheduled time because the system was powered down or anything else. So if you turn of your system at 1.00 and hav set the cronjob to do it on 1.30, the next time you boot, anacron will detect the missed job and will execute it...
maybe a litte script that checks the $(date) and compares it with preset dates will do better. This script should be called by cron.
One of the reasons that I am loth to try *buntu is the non-standard treatment of root.
BTW, I believe that it's not that these distros "has no concept of a root account", it's that root is effectively disabled by not having a password in the default configuration.
That said, here are the fixes I have heard about:
Code:
# Permanently enable "normal" root:
sudo passwd
# Start a root terminal session:
sudo su
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.