how to shutdown the system automatically in fedora linux

10:43 AM
Shutting Down Automatically


Your users are careless watt-wasters who refuse to develop the habit of shutting down their PCs at night, or maybe you think it would be nice to have your machine turn itself off at night, so you can just walk away and not worry about it.


It's easy as pie, thanks to cron. Add this line to /etc/crontab to automatically shut down your machine every night at 11p.m.:




# m h dom mon dow user command


00 23 * * * root /sbin/shutdown -h now




/etc/crontab is perfect for simple cron setups. Note that it has a name field, so any user can have entries in this file. However, only root can edit /etc/crontab.


Another way is to use the crontab command:


# crontab -u root -e




This opens the root user's crontab. Edit and save, and you're done. Don't try to name the file yourself—during editing, it's a /tmp file, which is automatically renamed by crontab when you save it. It will end up in /var/spool/cron/crontabs, or somewhere close by.

0 Comments