I am looking for a laptop auto shutdown or suspend to ram software.
I have one super good in windows. i wonder if there is one that is as good in linux.
I saw this software “sentinella” is as good…
It can trigger shutdown or suspend via cpu, via network tranfer rate via time via another package condition… but i can’t find it aur or depo
Kshutdown is an option, but not that rich in feature.
I want it to suspend my pc after timeshift finish backup… no idea if that works…
with windows os autoshutdown app, it can set to shutdown after hdd is not much transfer rate
qshutdown is another one, but even less feature than kshutdown.
I am trying kshutdown. but don’t know if it works.
I am running timeshift , doing backup for the first time for this laptop. running timeshift gui . I don’t know if timeshift will exit after finish backup… but trying anyway. because i need to sleep . late.
Why so complicated? I know you’re more into GUI’s but once you’ve set up Timeshift you can create a snapshot simply by running sudo timeshift --create in a terminal. Combine that with a suspend or shutdown command and you should be good to go.
Try the following in a terminal sudo timeshift --create && systemctl suspend
oh… i think it is nothing to do with timeshift isn’t it ? should be todo with linux terminal power of combining command.
I know tee can be use to tee the output to several outputs simultaneously, but have not learn about &&
May i know what is this && is under ? what should i search to get this && manual ? under OPERATOR ?
To (temporarily prevent your Linux machine from sleeping and suspending, disable the following targets at the systemd level sudo systemctl mask sleep.target suspend.target Other possible targets are hibernate.target and hybrid-sleep.target.
Create your Timeshift snapshot sudo timeshift --create
Re-enable sleep and suspend on your system after Timeshift exited sudo systemctl unmask sleep. target suspend.target
Suspend the system systemctl suspend
==> One liner to disable suspend, run timeshift, re-enable suspend and finally suspend system: sudo sh -c 'systemctl mask sleep.target suspend.target ; timeshift --create ; systemctl unmask sleep.target suspend.target ; systemctl suspend'
so complicated. lol wow!
there is so much cli can do on linux… that i don’t know where to start and where to stop… !!
I was making note of everything related prevent or make computer shutdown or suspend… so much stuff…
I will surely try it . thanks
The main command used to introspect and control systemd is systemctl. Some of its uses are examining the system state and managing the system and services.
systemd-suspend.service is a system service that is pulled in by suspend.target and is responsible for the actual system suspend. Note that systemd-suspend.service or systemd-hibernate.service should never be executed directly. Instead, trigger system sleep with a command such as systemctl suspend or systemctl hibernate.
By disabling (“masking”) the targets a symlink to /dev/null is created. From now on all attempts to invoke suspend or hibernate will be sent to /dev/null. Whatever you write to /dev/null will be discarded, forgotten into the void. It’s known as the null device in a UNIX system.
So if systemd is your main system and service manager this should theoretically have priority and keep your system from suspending. You’ll have to test this on your system yourself though.
Btw, you can check the .targets with systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
If you see something like “Loaded: masked (/dev/null; bad)” the service is disabled, otherwise it will show “Loaded: loaded (...”.
I just tried you single liner command … and it straight away goes into suspend mode.
I thought what script is that… does not work…
Than i realized i have a timeshift gui opened… *although it just open and do nothing. apparently that hinder the code from you to run. but since i closed the timeshift gui, it works… all thru cli… never experience timeshift in cli before…
something not that right…i never use this cli that you gave me before, hence i have no idea what is happening.
$ sudo sh -c 'systemctl mask sleep.target suspend.target ; timeshift --create ; systemctl unmask sleep.target suspend.target ; systemctl suspend'
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
/dev/sdc is mounted at: /run/timeshift/backup, options: rw,relatime
Creating new snapshot...(RSYNC)
Saving to device: /dev/sdc, mounted at path: /run/timeshift/backup
Synching files with rsync...
102.81% complete (00:00:00 remaining)
this status was there for quite sometime already…
so… is the timeshift ended doing it’s job ?
why the command prompt shows over 100% ? and the (00:00:00 remaining) ? it has being in remaining time 0:0:0 for quite sometime already… still there.
I thought it has frozen or ended , but still showing that…
but as i was typing, the % changed to 104.05% with (00:00:00 remaining).
How come it took so long for timeshift to backup ?
Accidentally happened, as i was trying to copy the output of the timeshift. instead of copy, i cancelled it…
hence i restarted the exact same command again… it still not running fast.
for 5 minutes already, but only at 10%… is that consider fast ? for a timeshift that i have just done a couple minutes ago ?