LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-27-2020, 02:50 PM   #1
AwesomeMeAY
LQ Newbie
 
Registered: May 2020
Posts: 2

Rep: Reputation: Disabled
How would I make my PC shutdown automatically without logging in?


How would I go about that? I tried cron jobs but they don't work without logging in.
 
Old 05-27-2020, 02:57 PM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
If you're using the shutdown (or indeed any) command in a cron job it's always recommended to specify /the/full/path/to/the/command

So you might find that using /sbin/shutdown -h now in your cron job may work.
 
2 members found this post helpful.
Old 05-28-2020, 03:54 PM   #3
AwesomeMeAY
LQ Newbie
 
Registered: May 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
If you're using the shutdown (or indeed any) command in a cron job it's always recommended to specify /the/full/path/to/the/command

So you might find that using /sbin/shutdown -h now in your cron job may work.
This worked! Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the default powerstate (e.g. S3,S4,S5) for the command 'shutdown -hP' or 'shutdown -hH' or 'shutdown -h' badbetty Slackware 6 11-12-2017 12:18 AM
Need to create a shell script that would automatically backup and shutdown Daggaroth Programming 6 12-03-2010 11:19 AM
Why is mysql automatically logging me in without .my.cnf or my.cnf sections? alunduil Linux - Server 11 05-19-2010 11:52 AM
Shutdown Automatically without switching off power sukhen Linux - Newbie 5 02-13-2006 12:24 PM
using red-carpet without logging out and logging as root. packman Linux - Software 1 12-09-2002 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration