Skip to main content

Schedule Shutdown in Linux

Some time we need shutdown process be automatically and our computer Shutdown automatically on particular time, this can be possible with Job scheduling

In Linux For Job Scheduling 2 utility available one is "at" and second is "cron"

at- Execute a task at a specific time. and "at" is Useful only to schedule one job at a time or a single future event. in this we can not define recurring events or daily events.

for shutting down Linux automatically at 11:59 pm, use following example.

# at 11:59pm
at> halt
(Press CTRL+D)

Some more command for "at"

  • atq - List the current "at" jobs pending.
  • atrm - Used to remove pending "at" jobs.

Linux Cron job to Shutdown Linux server/Desktop system:

cron – cron is Linux command line task scheduler, Useful to schedule recurring events or daily events such as backup, check system security etc.

Step 1 - Login as root user and at shell prompt type crontab -e command so that you can add cronjob.

# crontab -e
Step 2 - above command open root users crontab file in vim editor and then Append following entry to it (shutdown at 23:59 hrs (24 hrs format).

59 23 * * * /sbin/shutdown -h now

(3) Save the changes and exit from vim editor to shell prompt.

Comments

Popular posts from this blog

SharePoint WebPart Error - Unable to add selected web part (s) – MOSS 2007

ISSUE: Recently I faced this issue that when I try to deploy my WebPart.  Unable to add selected web part(s). WebPartName: Cannon unregister UpdatePanel with ID ‘ctl00RTMPanel’ since it was not registerd with the ScripManager. This might occure if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel.   I faced this issue twice and both the time the issue was not what display here. This could be sure to any error in the WebPart. Following are list resolution from multiple instances.   RESOLUTION: 1. Check the WebPartName.webpart file. Check whether you have a proper PublicKeyToken value. When I face the issue the value was PublicKeyToken=$PublicKeyToken$. If you have used WSP builder then in the Visual Studio you will find this file at \WebPartsProject\12\TEMPLATE\FEATURES\WebPartName\WebPartName.webpart. Sometime when you create a new WebPart using WSP builder then you do not get

TIME – 25 Best Blogs of 2009

Every year Time makes a list of best blogs in the world. They chose 25 blogs from millions of blogs in the world, spanning politics, housekeeping, astronomy and everything in between. Below if a direct link to the TIME website for the list. I also copied it to easy comparison of last year best with this year best blogs.   25 Best Blogs of 2009     25 Best Blogs 2008   25 Best Blogs of 2009 Talking Points Memo The Huffington Post Lifehacker Metafilter The Daily Dish by Andrew Sullivan Freakonomics BoingBoing Got2BeGreen Zen Habits The Conscience of a Liberal: Paul Krugman Crooks and Liars Generación Y Mashable Slashfood Official Google Blog synthesis bleat /Film Seth Godin's Blog Deadspin: Spor

Howto Run Your HTML Static Website Locally In IIS On Windows PC

WHAT & WHY: As a developer many time you may wish if you could run your static HTML website locally on your computer (Windows 7, Windows Vista, Windows XP, Windows 2008). Although with Static website, you could easily download and double click the index.html or home.html file to open and run other pages. But this will not give you the real world senario. For example you will not able to use a path like /images/home-page-banner.jpg. You will have to use a relative paths like ../images/home-page-banner.jpg. Following are very easy steps to do so. These steps are for Static HTML website. I will also post steps for more advance websites that uses ASP, ASP.NET, Dotnetnuke etc and uses database server.   WHAT YOU NEED: 1. IIS Server installed on your local machine 2. FTP username, password to download files form your FTP server 3. Administrative rights on local machine. Many task will display messages requesting Administrative privilege to run the task.    STEPS: 1.