- This topic has 47 replies, 10 voices, and was last updated Apr 21-11:50 pm by BobC.
-
AuthorPosts
-
February 9, 2020 at 6:50 am #32564Moderator
BobC
If anyone is interested I can post it (if allowed to), or email it to interested people.
I don’t want to upset anyone by posting it, and I don’t think creating a respin for minor improvements is rational.
All I did was to run the apt update via cron hourly, and take the last line of its output, and put it to a text file in /tmp. Then in the conky I run a script once every 60 seconds that displays the one line text file if it exists.
As I see it, its not much different than displaying the automount status info in the conky, and the only problem I have with it is that the text is too long to fit well. I guess it would be cooler if it did different colors depending on the status, but I never was able to figure that out. It doesn’t require any significant extra memory or code. PPC’s or Brian’s yad-updater stuff could be tweaked to feed it pretty easily.
Attachments:
February 9, 2020 at 7:37 am #32566Member
manyroads
::Given you like to run skinny @BobC, why are you updating your conky so frequently? Wouldn’t every 12 hours be adequate? You might consider doing similar with other execi commands to reduce CPU use (just a style thing)
Pax vobiscum,
Mark Rabideau - http://many-roads.com
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
dwm & i3wm ~Reg. Linux User #449130
20 Jan 2021 ~ "End of an Error"February 9, 2020 at 8:28 am #32567ModeratorBobC
::I just wrote it last night, so it’s only been running less than a day at this point. I am not and will not be running the upgrade from it. I am just looking for it to put what’s available on the screen so I can be more aware of if there are updates available. On any given machine I had no idea as it was.
Typically I only do upgrades after a backup, and maybe once a week, if that, unless there is something critical. Some machines that don’t get used much are months old, I bet.
I am planning on having it run the update maybe twice a day, will probably just have the conky redisplay the file once per hour, and then run the backup to a snapshot and prompt for the upgrades weekly on the weekend when I might have time.
PS: Yes, on the slower machines I run things at much wider intervals. On my old machines, I try to make them idle at 2% CPU or less, and I would plan on the update itself daily, for example.
And, yes, You are right, updating a screen every minute that is only going to change a few times a day is silly…
- This reply was modified 3 years, 3 months ago by BobC.
- This reply was modified 3 years, 3 months ago by BobC.
February 9, 2020 at 2:05 pm #32572ModeratorBobC
::I see anti got a package posted that includes a notifier.
anti cares about his system and the people running it.
People notice things like that…
Good Job, anti!
February 9, 2020 at 4:24 pm #32575Moderator
Brian Masinick
::Whether we use every idea, tool, package or not isn’t the point.
I think that software experimentation and trying diverse ideas is a great way to stumble upon the next interesting technology.
In this case we are trying various scripts to check (or update) the system status. We know that there are lots of ways to do this and different people prefer different methods and tools.
I’m encouraged to see this kind of stuff happening. Keep up the good work 👌
--
Brian MasinickFebruary 9, 2020 at 8:03 pm #32579Member
AntixDingo
::FWIW, the repo update site (https://antixlinux.com/mirmon-packages/) is great. Why aren’t other distro-devs doing similar? Given, I’m not able to comment comprehensively, but, to find the equivalent info for Debian Main is like 5 or 6 links deep. So, if you don’t know to look for it, you’ll probably never find it.
Maybe cron solves most things.
Thanks again.
Few things as strong as a well-timed idea.
February 10, 2020 at 10:57 pm #32606ModeratorBobC
::Hmmmm, cron is running, but I restarted my system with my check for updates script in /etc/cron.hourly (just to test it), but it didn’t run. Maybe I just need to wait an hour? That’s not very good…
I am thinking of having it run anytime the machine is rebooted
February 11, 2020 at 4:17 am #32608Memberex_Koo
::@BobC
What type computer do you run. You live on the edge with memory.But then again you have open
2 firefox
4 terminals
file manager
geany
network settings
conky runningDoes it ever get a bit on the slow side.
February 11, 2020 at 5:04 am #32609ModeratorBobC
::The one I am using for this is a Dell D620 with 2 gb of memory from 2005 that I won on a bet. There are actually about 30 Firefox tabs open between the two windows. That’s why it is using lots of memory. No, I’m not really having any performance issues.
My problem is that the cron doesn’t run my script from /etc/cron.hourly automatically as I expected. I also tried running it from ~/.icewm/startup after the network interface is up and that didn’t work at all, either. It does work fine from a terminal when run with sudo. The part that displays it on the conky screen also works fine.
I admit that I’ve never used cron to run anything before. ps -ef does say that cron is running.
I will post the zip file, but with the understanding that it needs help, not as something expected to be working.
bobc@d620:/tmp $ sudo aptupdatescheck.sh [sudo] password for bobc: bobc@d620:/tmp $ ls -l total 20 -rw-r--r-- 1 root root 545 Feb 11 05:39 aptupdatescheck_0.log -rw-r--r-- 1 root root 71 Feb 11 05:39 aptupdatescheck_1.log -rw-r--r-- 1 root root 71 Feb 11 05:39 aptupdatescheck.txt drwx------ 2 bobc bobc 4096 Feb 11 05:39 mc-bobc -rw-r--r-- 1 bobc bobc 362 Feb 11 05:37 startup.log bobc@d620:/tmp $ mc bobc@d620:/tmp $ ls -l /usr/local/bin/apt* -rwxr-xr-x 1 root root 447 Feb 10 23:07 /usr/local/bin/aptupdatescheck.sh bobc@d620:/tmp $ ls -l /etc/cron.hourly/apt* -rwxr-xr-x 1 root root 447 Feb 10 23:18 /etc/cron.hourly/aptupdatescheck.sh bobc@d620:/tmpAttachments:
February 13, 2020 at 6:57 pm #32719Moderator
christophe
::I set it up, but I’ve run into the same situation you described, Bob — not outputting anything to conky. That was all I was looking for: conky displaying if anything was available… The scripts are beyond my understanding, at this point. But I’ll keep the scripts, and when I can follow the code better, maybe I can contribute…
confirmed antiX frugaler, since 2019
February 14, 2020 at 3:43 pm #32754Memberex_Koo
::Try this.
${execi 3600 aptupdatesconky.sh | wc -l}#BobC
If you want I can send you a 2gb ddr ram stick for free. As the D620 has two ram slots.- This reply was modified 3 years, 2 months ago by ex_Koo.
February 15, 2020 at 8:51 am #32774Moderator
christophe
::I dug around and (eventually) found this to work:
1. copy aptupdatescheck.sh & aptupdatesconky.sh to /usr/local/bin (ensure they are executable)
2. run
sudo crontab -u root -lwhich lists root’s cronjobs. I had none.3. run
sudo crontab -u root -ewhich edits roots cronjobs4. add one, like this:
@hourly bash /usr/local/bin/aptupdatescheck.shwhich sets the script to run at the top of each hour. It seems to need “bash” in front of the script, and the full path to the script.5. add at end of ~/.conkyrc
${color}${alignc}${execi 600 aptupdatesconky.sh}— just my tweak of BobC’s conky line (the original works just fine, though).And it worked. I checked that the tmp files were created just to make sure.
Additional note – I removed all manual edits I made to crontab & /etc/cron.hourly. And it worked without that. (I credit this to the mystery of Linux. Perhaps someone else may know what the point of those files are…)
Another note – I am running live, and cron was running automatically (NOT using disable=l boot parameter).
So my setup is only checking if updates are available via cron (at the top of each hour), and displaying this info (refreshing every 10 minutes) in conky. I’ll run the yad-updater or cli-aptiX (or command-line) myself.
So many thanks to everyone (BobC et al.) for this. I’m really enjoying it!
Additional info on the crontab command is here:
https://www.guru99.com/crontab-in-linux-with-examples.html- This reply was modified 3 years, 2 months ago by christophe.
- This reply was modified 3 years, 2 months ago by christophe.
Attachments:
confirmed antiX frugaler, since 2019
February 15, 2020 at 6:32 pm #32793Memberex_Koo
February 15, 2020 at 8:48 pm #32799Moderator
Brian Masinick
February 16, 2020 at 2:16 pm #32844ModeratorBobC
::I keep learing…
Next time I need to get it all working somehow as a complete subsystem and figure out a way to provide an install script that will install everything where it belongs, etc. The big issue there is the root authority question. I don’t know any easy way out on that. Maybe it needs to be in a package, etc.
Thanks to PPC for providing the original code and Christophe for figuring out how to make it work with cron.
-
AuthorPosts
- You must be logged in to reply to this topic.

