Amongst the stuff I keep in my 'Puppy-Stuff' data partition, I have a couple of small scripts for those occasions when I want to shut Pup down after a given interval. One is for 30 minutes, the other is for 60 mins. It is, however, a very simple matter to edit the script and substitute the number of minutes required, in order to shut Pup down at the time you want.

Here's the 30-minute one:-

Code:

#!/bin/sh
sleep 30m && wmpoweroff &

Open Geany, copy'n'paste that into it, then save it with a name you'll recognise. I find the best place to keep it is in /root. Make sure you've made it executable; easiest way is just to rt-clk->Properties, then tick the 'Execute' checkboxes down the bottom, followed by clicking on 'Refresh'. The 'Run action' will change to 'execute', and the script title will change from black text to green.....indicating it's now executable (although using the '#!/bin/sh' prefix on the first line should save it as executable anyway).

To change the value, rt-clk->Open as text, or Open with Geany. Geany should open with the contents of the script. Edit accordingly.....and don't forget to 'Save' before you close Geany.

Hope that helps. You could enter that direct into the terminal.....but you would have to re-type it every time. A script allows the same action to be used again & again, just by clicking on it.

Whenever you need it, just open it in Geany, modify the value accordingly, 'Save', exit.....then click on it. Simple.

-----------------------

@Galbi:-

I think you'll find the instructions on that page you linked to would work fine for mainstream Linux distros.....but of course, we all know Pup is far from being 'mainstream'.

The code I've quoted I discovered here on the Forum somewhere; I forget where, but I know it was quite an old post... It does, however, work perfectly for the inhabitants of my kennels!

Posted: Sun 12 Nov 2017, 07:44 Post subject:
Re: How to shutdown the pc on a specific time on terminal?

lolo69 wrote:

A script or even an app to "poweroff" the pc at a specific time?

If you want to shut down at a specific time (and not after an elapsed time) you could try Pschedule. I don't know your Slacko 6.3 but you may find Pschedule in Menu => System => Pschedule task on time.

Click on "Schedule new task", in the Command field type wmpoweroff, select the desired time for this task and add it to the task list. That should be all.

I'm not sure what "on terminal" in your thread title means. Pschedule is a graphical front-end to create cron jobs. If you really want to use the terminal then Pschedule is not for you. Still I would recommend that you don't mess with crontab files on the command line.

Posted: Sun 12 Nov 2017, 19:31 Post subject:
Re: How to shutdown the pc on a specific time on terminal?

MochiMoppel wrote:

lolo69 wrote:

A script or even an app to "poweroff" the pc at a specific time?

If you want to shut down at a specific time (and not after an elapsed time) you could try Pschedule. I don't know your Slacko 6.3 but you may find Pschedule in Menu => System => Pschedule task on time.

Click on "Schedule new task", in the Command field type wmpoweroff, select the desired time for this task and add it to the task list. That should be all.

I'm not sure what "on terminal" in your thread title means. Pschedule is a graphical front-end to create cron jobs. If you really want to use the terminal then Pschedule is not for you. Still I would recommend that you don't mess with crontab files on the command line.

Thanks for the tip on this one, MochiMoppel. I've occasionally looked at this, but never really figured out what it was for.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum