You are not logged in.
Pages: 1
I know that when I'm on the shell I can use pacman or yaourt to update my system, I can see if there is any new packages and update them. What I would like is a way to receive a daily email showing updated packages so I can remotely log on the server and update the system if I judge the updates important enough.
I already do a similar thing on my FreeBSD boxes (I'm more of a BSD guy than a Linux one, but I digress).
While thinking more about it, would something like this work:
pacman -Syy >/dev/null | yaourt --query --upgrades --aur
EDIT: Solution: see my last post in this thread.
Last edited by lebel (2012-03-16 01:07:36)
Offline
A quick search turned up this, which needs some tweaking to generate emails, but it's close to what you want.
Offline
Have a look at http://www.andreascarpino.it/blog/posts … s-part-ii/ too.
Edit: wrt to e-mails, I suggest something lightweight, like mailx:
echo "$(<your command goes here>)" | mailx -s "daily update" your.mail@gmail.com
Last edited by karol (2012-03-15 19:26:33)
Offline
There's no reason to use "pacman -Syy" in that script. It just wastes bandwidth. One "-y" is enough.
Btw, can't yaourt update the database on it's own?
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I think I might have made it to work and do what I want, I have the following in my cronjob:
(yaourt -Sy >/dev/null && yaourt -Qu --aur) | mailx -E -s "ozone.mydomain.com: new packages" root@mydomain.com
And it works just fine and right now only display:
extra/libsocialweb 0.25.20-0
Offline
There is also no reason to use -Sy at all, because it makes it too easy to break your system. Try Xyne's python based update notifier, it does the correct thing. Or checkupdates, which is bash based. (And will be in contrib once I get emailing patches sorted out.) There is also cron-pacmatic as part of the pacmatic package, which reports updates and a few other things too.
Offline
There is also no reason to use -Sy at all, because it makes it too easy to break your system.
Why? With yaourt (or pacman) -Sy, only the database of the packages are updated, if need be. Two "y" would download the database for each repo even tho they weren't modified.
The following generate a proper simple output of the out of date packages.
(yaourt -Sy >/dev/null && yaourt -Qu --aur) | sort | mailx -E -s "cumulus.mydomain.com: new packages" root@mydomain.com
The output is even sorted.
(eg. the current output on one of my machine is:
aur/dnscrypt-proxy 0.9.3-1
core/bash 4.2.024-1
core/libedit 20120311_3.0-1
core/mkinitcpio 0.8.4-1
core/mkinitcpio-busybox 1.19.4-2
core/sudo 1.8.4.p4-1
core/udev 181-4
core/usbutils 005-1
core/util-linux 2.21-5
extra/lua 5.1.5-1
Offline
If you run 'pacman -Sy' and then 'pacman -S foo' you might run into some issues. The whole point of the script is to update only when needed and I'm not sure if you will remember to run 'pacman -Su' / 'pacman -Syu' before installing new packages.
That's why you should use e.g. a fake db instead of the regular one.
Offline
keenerd wrote:There is also no reason to use -Sy at all, because it makes it too easy to break your system.
Why? With yaourt (or pacman) -Sy, only the database of the packages are updated, if need be. Two "y" would download the database for each repo even tho they weren't modified.
When you run "pacman -Sy", you download the latest database files. After that point, any packages that you install will be the latest versions. If you don't run "pacman -Su" first, then you may install a new package without updating one of the libraries that it depends on, which may break the package. That is why it is recommended to always run "pacman -Syu". It makes sure that you always have consistent dependencies.
Or course, if you know for sure that you will never install a package without running "pacman -u" first, then it doesn't matter. If that is not the case, it would be better to create a separate directory, symlink "/var/lib/pacman/local" into that directory, and then use that directory as the database directory in your scripts (pacman -Syb /path/to/dir). That way, the system database is not affected. To save further bandwidth, you can just copy the downloaded databases in the alternative database directory into the default database directory when you want to update the system databases.
Last edited by Xyne (2012-03-15 20:50:16)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
If you run 'pacman -Sy' and then 'pacman -S foo' you might run into some issues. The whole point of the script is to update only when needed and I'm not sure if you will remember to run 'pacman -Su' / 'pacman -Syu' before installing new packages.
That's why you should use e.g. a fake db instead of the regular one.
Well, I know the way it works in Archlinux is that you should be sure that your whole system is updated before installing new packages. The purpose of this script is to be aware that new packages are available on specific servers so I can go and update the system if need be (and before I need to install any new things).
Offline
Or course, if you know for sure that you will never install a package without running "pacman -u" first, then it doesn't matter. If that is not the case, it would be better to create a separate directory, symlink "/var/lib/pacman/local" into that directory, and then use that directory as the database directory in your scripts (pacman -Syb /path/to/dir). That way, the system database is not affected. To save further bandwidth, you can just copy the downloaded databases in the alternative database directory into the default database directory when you want to update the system databases.
You have a really good point here. If I were to keep that "temporary/permanent local" directory on the system and always work from there, it wouldn't messes with the "production/real" pacman database and still show me what I want. Thank you for the precision. I hope I get it correctly.
Offline
It's your system and it's up to you to employ a simple but a bit risky way of doing things.
https://bbs.archlinux.org/viewtopic.php?id=89328 is 2-years old but still should give plenty info on this subject.
Offline
It's your system and it's up to you to employ a simple but a bit risky way of doing things.
https://bbs.archlinux.org/viewtopic.php?id=89328 is 2-years old but still should give plenty info on this subject.
My new cronjob looks like this now:
(rsync -a /var/lib/pacman/. /var/lib/pacman.local && pacman -Sy -b /var/lib/pacman.local >/dev/null && yaourt -Qu --aur -b /var/lib/pacman.local) | sort | mailx -E -s "cumulus.mydomain.com: new packages" root@mydomain.com
It copies the content of the current "production" database into /var/lib/pacman.local, update it with -Sy and then check if there is new packages available without ever touching the current system database.
Is this more sensible?
Offline
(rsync -a /var/lib/pacman/. /var/lib/pacman.local && pacman -Sy -b /var/lib/pacman.local >/dev/null && yaourt -Qu --aur -b /var/lib/pacman.local) | sort | mailx -E -s "cumulus.mydomain.com: new packages" root@mydomain.com
It copies the content of the current "production" database into /var/lib/pacman.local, update it with -Sy and then check if there is new packages available without ever touching the current system database.
Is this more sensible?
Looks like -b on yaourt doesn't work as with pacman, so it doesn't use the "copy" of the database I made with rsync.
Offline
If you know Python, you could easily modify the display function of Paconky to return the list of upgradable repo and AUR packages.
Another approach would be to just rsync the server's local database to your system and check it locally for updates.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Pages: 1