|
3 years ago 0 |
One thing, Linux Mint is not very famous for (but getting better) are automatic updates! :( You know that kind of simple thing every Windows user never needs to care about!? By default, Windows just installs important updates! That's it!
Using Mint, you can enable it by cron once a day but you do not really recognize it.
So I developed a tiny little script that will do it a bit different!
E.g. you get some notifications that it is checking, updating, ...
And because I think it could be helpful for more people here a small tutorial what it does and how to install it:
It is just a kind of wrapper around mintupdate-cli/tool
that does the real stuff.
Nowerdays a normal user has a notebook, laptop, ultrabook or similar. You just use it. Take it, open it, close it, leave it, ... It will suspend and resume a couple of times a day.
And this is where my script hooks in. On every wakeup, it will be called. And with a quite intelligent neat algorythm *haha* it will check for new updates maybe 1-3 times a day. (Even if there are some hundred resumes.) Together with the ability to send some destop notifications.
It will be hooked into /lib/systemd/system-sleep
. Thus it will be called on every suspend/resume.
Then it checks its last run and it that was too early ago, nothing will happen. Otherwise minteupdate-cli/tool will be called to check for and install the updates (depending on your needs).
Sounds simple!? Yes! Using my script it (hopefully) is that simple.
$HOME/bin
(or any folder you like)> chown 755 $HOME/bin/mintupdate-on-wakeup
> sudo ln -s $HOME/bin/mintupdate-on-wakeup /lib/systemd/system-sleep/
/var/log/mintupdate-on-wakeup.log
for details.
Well... Since the introduction of mintupdate-cli/tool
it is quite easy to start updating from a script.'
So I thought I just needed an automatism thar fits my needs. But damned, it was quite tricky to resolve some issues being called from systemd (root), launching a backround process and sending notifications from root to the desktop user...
Placing a script in /lib/systemd/system-sleep
is quite easy.
Because I want to know when it is working, throwing some notifications would be nice, I thought.
By using notify-send, this is quite easy. Just do it!
So I needed a while to figure all that out. But I could solve all issues, i think. (I am not sure about DBUS, if this is waterproof. But anyway, the only thing that not happens, if there is a problem are notiifications. ;) )
So have fun and hopefully no pain with it.
I am open for any kind of feedback, credits, feature-requests, donations, praise, ... :D
Cheers,
Enkidu
> sudo apt-get install ...
Damned... Needed 2 years to switch from Mint 18 to 20.1... :D
But finally it is done and my script now works with LM >18 too! ;)
Thanks for your work on this.
I eagerly await an LM19 version
@ZeckeSZ, as I already wrote in my text above, I have developed it on LM18 and there is no mintupdate-cli, only mintupdate-tool.
I will port it asap.
Calling mintupdate-tool in terminal shows this hint:
"mintupdate-tool is depecrated, please use mintupdate-cli instead"
@remoulder, this is just a bash script, not a binary, dude.
You can take a look into it and will see, it does not do anything bad. (As long as you trust mintupdate-tool :D)
Very /helpful/ comment. Tnx. :(
It would have been more useful if you'd take a look into it, review it and give some real helpful comment on it.
WARNING: Do not install software from unknown sources