Gentoo itself is power

15.03.2009

update gentoo по cron

Filed under: gentoo, linux — init_6 @ 16:47

Использую notify.sh Все просто до безобазия.
Итак сам скрипт


cat /usr/local/bin/update

#!/bin/sh
#update for gentoo
#emerge --sync
/usr/bin/emerge --sync && /usr/local/bin/notify.sh "Обновление" "Portage обновлены до "$(date +%D) 60000 normal /usr/share/icons/gnome/scalable/status/dialog-information.svg  transfer.complete || /usr/local/bin/notify.sh "Обновление" "Обновление portage завершилось неудачей" 60000 critical /usr/share/icons/gnome/scalable/status/dialog-error.svg  transfer.error;
#layman -S
/usr/bin/layman -S && /usr/local/bin/notify.sh "Обновление" "Оверлеи обновлены до "$(date +%D) 60000 normal /usr/share/icons/gnome/scalable/status/dialog-information.svg  transfer.complete || /usr/local/bin/notify.sh "Обновление" "Обновление оверлеев завершилось неудачей" 60000 critical /usr/share/icons/gnome/scalable/status/dialog-error.svg  transfer.error;
#emerge -uDNv @world
/usr/bin/emerge -uDNv @world && /usr/local/bin/notify.sh "Обновление" "Мир обновлен" 60000 normal /usr/share/icons/gnome/scalable/status/dialog-information.svg  transfer.complete || /usr/local/bin/notify.sh "Обновление" "Обновление мира завершилось неудачей" 60000 critical /usr/share/icons/gnome/scalable/status/dialog-error.svg  transfer.error;
#emerge @preserved-rebuild
/usr/bin/emerge @preserved-rebuild &amp;&amp; /usr/local/bin/notify.sh "Обновление" "<strong>emerge @preserved-rebuild</strong> завершился успешно" 60000 normal /usr/share/icons/gnome/scalable/status/dialog-information.svg  transfer.complete || /usr/local/bin/notify.sh "Обновление" "<strong>emerge @preserved-rebuild</strong> завершилось неудачей" 60000 critical /usr/share/icons/gnome/scalable/status/dialog-error.svg  transfer.error;
#revdep-rebuild
/usr/bin/revdep-rebuild &amp;&amp; /usr/local/bin/notify.sh "Обновление" "<strong>revdep-rebuild</strong> завершился успешно" 60000 normal /usr/share/icons/gnome/scalable/status/dialog-information.svg  transfer.complete || /usr/local/bin/notify.sh "Обновление" "<strong>revdep-rebuild</strong> завершилось неудачей" 60000 critical /usr/share/icons/gnome/scalable/status/dialog-error.svg  transfer.error;

Теперь очередь cron

cat /etc/cron.daily/update


#! /bin/sh

/usr/local/bin/update

Делаем скрипты исполнимыми
chmod +x /etc/cron.daily/update
chmod +x /usr/local/bin/update

Наслаждаемся.

About these ads

Добавить комментарий »

Комментариев нет.

RSS-лента комментариев к этой записи. TrackBack URI

Добавить комментарий

Заполните поля или щелкните по значку, чтобы оставить свой комментарий:

Логотип WordPress.com

You are commenting using your WordPress.com account. Log Out / Изменить )

Фотография Twitter

You are commenting using your Twitter account. Log Out / Изменить )

Фотография Facebook

You are commenting using your Facebook account. Log Out / Изменить )

Connecting to %s

Theme: Silver is the New Black. Блог на WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 39 other followers

%d bloggers like this: