SDB:Starting YaST Online Update from a cron Jon or Script

Şuraya atla: kullan, ara


Version: 8.1

Situation

You want to start the YaST Online Update (YOU) from a cron job or a script. There are three possibilities to start YOU in SuSE Linux 8.1: in graphical mode from the YaST2 menu, through the NCurses interface, or with the command online_update.

Procedure

The tool online_update is specially suitable for cron jobs and scripts.

Usage: online-update [-u url] [-p product] [-v version] [-a arch] [-d] [-s] [-n] [-g] [-i] [security] [recommended] [document] [optional]
-u url      Base URL of directory tree from which to get patches.
-g          Only download patches; do not install.
-i          Install downloaded patches; do not download.
-p product  Name of product for which to get patches.
-v version  Version of product for which to get patches.
-a arch     Base architecture of product for which to get patches.
-d          Dry run. Only get patches; do not install them.
-n          No signature check of downloaded files.
-s          Show list of patches.
-V          Be verbose.
-D          Debug output.
security | recommended | document | optional   Types of patches to install.

Because not all YOU users know how to set a cron job, a short description follows. There are basically two ways of setting a cron job. The easiest method is as follows:

  1. Log in as root.
  2. Start the crontab editor with crontab -e.
  3. Enter i for the insert mode of the started vi editor.
  4. Insert the following lines:
  MAILTO="root"
  13 3 * * 0   /usr/bin/online_update -g
  53 3 * * 0   /usr/bin/online_update -i

The meaning of the first five positions in both lines from left to right is: 13=minutes, 3=hours, *=day of the month (not important), *=month of the year (not important), 0=Sunday According to this, the first entry starts a cron job Sundays at 03:13 a.m. The second, 40 minutes later at 03:53 a.m. ATTENTION: Do not use the same time as in the example. Otherwise, the FTP server may be overloaded at this time or the number of accesses will exceed the maximum number allowed.

In addition, note that when updating without surveillance, you can miss important messages from online_update. Some packages may cause problems during the update, for example, glibc or the kernel. In other cases, the user might have to intervene (e.g., for a reboot or to run lilo). For this reason, use this solution only if you know what you are doing.

  1. Save the cron job by entering consecutively

Esc :wq or Esc ZZ

The cron daemon will be automatically restarted and the cron job will be stored in the file /var/spool/cron/tabs/root.

<keyword>yast,you,online,update,patches,ftp,server</keyword>