Useful scripts for administrators/users
Go to file
Guillaume Raffy 3f371e27c1 fixed bug in the cluster node automatic update system that caused the apt security updates to be ignored by the mechanism that checks if an update is required.
this misfunction was picked up by xymon/apt, which comainted that the Last apt update was too old

This regression was introduced in commit [29ce88975f], which replaced the unattended upgrade mechanism with the cluster cron based autoupdate mechanism (but only for alambix clustern, for some reason)

The bug in the cluster cron based autoupdate system was caused by the fact that the code forgot to update the package list before calling apt list --upgradable. As a result, the package list was never updated on alambix, and therefore scurity updates were never seen. This problem was not present on physix, which does still have the unattended upgrade mechansim along with the cluster cron based autoupdate system.

fixes [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3810]
2024-04-10 17:04:02 +02:00
app Reprepro: Fix new homedire path 2023-07-07 08:45:14 +02:00
ceph Improve script 2022-08-02 16:51:03 +02:00
cluster fixed bug in the cluster node automatic update system that caused the apt security updates to be ignored by the mechanism that checks if an update is required. 2024-04-10 17:04:02 +02:00
dell Fix type in var name 2023-05-04 09:38:12 +02:00
docker Be sure to have version sorted! 2021-01-11 10:45:07 +01:00
duplicati Move to ed25519 for FOTON sshkey 2023-03-13 10:58:13 +01:00
fiber_channel Rename scripts 2018-04-26 16:34:23 +02:00
github Ensure to create temp file to monitore… 2023-12-08 11:54:28 +01:00
proxmox git.ipr: New main domain 2023-11-03 15:54:59 +01:00
ur Update debug messages 2023-05-04 09:49:37 +02:00
xymon unknown macostatus = red alert 2021-01-15 21:17:06 +01:00
zfs Manage old users that no longer uses any space 2022-08-18 15:20:40 +02:00
CHANGELOG First commit: 2014-09-08 09:59:12 +02:00
README.md git.ipr: New main domain 2023-11-03 15:54:59 +01:00
TODO.md sesame2mail: can now convert one user ID passed in arg to it's mail address 2017-01-17 18:27:37 +01:00
block_list.sh Small script to parse fail2ban's log files and extract the IP banned in 2014-12-05 10:25:23 +01:00
copy_to_usb.sh Rename fullusb.sh to copy_to_usb.sh 2016-09-15 15:29:29 +02:00
lsusers.py lsusers.py Set +x 2023-02-22 11:15:50 +01:00
make.iso.preseed.sh Update to Debian latest version 2020-03-30 09:11:12 +02:00
remountdefault Remove "none" test to be able to manage bind mounts 2018-03-12 13:48:01 +01:00
remountrw Add a script to remount devices with extra rights 2018-03-12 13:47:53 +01:00
smart.run.test.sh Run smartctl command to launch test 2020-02-27 16:36:52 +01:00
snapsend.sh Fix for snapsend.sh: 2014-11-21 15:10:03 +01:00
update_iso.sh Use $() instead of `` 2017-02-15 14:39:37 +01:00
zfSnap.sh Add zfSnap script from the legacy branch of the github project: 2014-11-18 16:06:51 +01:00
zfs.set.ibm.vdev.id.sh Add a script to generate ZFS's vdev file for IBM 2018-06-21 15:09:25 +02:00
zpool.creation.sh Exist if partitionned disks are found 2018-06-25 17:07:19 +02:00

README.md

ipr_scripts

Table of Contents

  1. Overview
  2. Scripts

Overview

Some usefull scripts for admin or users.

Scripts

Proxmox

proxmox.template.debian.sh

Some commands in order to clean and prepare a container to become a template.

  1. The script will:
  • Allow root's connection to SSH with password.
  • Reconfigure timezone to Europe/Paris.
  • Reconfigure locales to en_US.UTF-8.
  • Download an additionnal script use by our preseed with PXE to configure logs (rsyslog, logrotate,…).
  • Remove x11 useless packages.
  • Clean some stuff (downloaded packages, empty logs,…).
  1. How-to use:
wget https://git.ipr.univ-rennes.fr/cellinfo/scripts/raw/master/proxmox/proxmox.template.debian.sh -O /tmp/proxmox.template.debian.sh
chmod +x /tmp/proxmox.template.debian.sh
/tmp/proxmox.template.debian.sh

vzdump-hook-lxc-stretch-template.pl

This script must be used as a vzdump's hook (the backup utility for CT and VMs for Proxmox).

  1. The script will:
  • Copy the current dump as a template in /mnt/zfsbkp/template/cache (by default).
  • Unlink $TEMPLATE_FILE_LINK.
  • Link $TEMPLATE_FILE_LINK to the last dump in order to have a better name.
  • Remove the templates oldest than 2 days (by default).
  1. How-to use:
  • Define a backup as usual (in the Proxmox's webgui) and prefer to select only one container.
  • In command on the hypervisor, open /etc/pve/vzdump.cron and edit the line of the new dump to add: --script /usr/local/bin/vzdump-hook-lxc-stretch-template.pl.
  1. Customization:
  • If you don't store template in the default path (/mnt/zfsbkp/template/cache), please edit the variable $TEMPLATE_DIR in the script.
  • You might want to set another template name, please edit the variable $TEMPLATE_FILE_LINK in the script.

vzdump-hook-lxc-jessie-template.pl

Same as above but set jessie in $TEMPLATE_FILE_LINK.

Fiber Channel

Some scripts to manage hard disk with IBM trays.

Grav

grav_cron

A daily cron to check if Grav got available updates.

  • It need to work from the Grav's root directory.
  • If an update is available, it will create a empty file (${GRAV_ROOT}/logs/update), else it will ensure the "update" file is removed.
    • Be sure to monitore if ${GRAV_ROOT}/logs/update exist.

Sesame2mail

Give a user's mail address from it's user ID (sesame).

The first argument can be:

  • A file with a list of user ID (sesame), one per line.
  • A user ID (sesame), only one.

Jenkins

jenkins_check_update

A daily cron to check Jenkins's plugins updates.

  • It need jenkins-cli.jar.
  • If an update is available, it will create an empty file (${JENKINS_HOME}/.update_plugin), else it will ensure the "update" file is absent.
    • Be sure to monitore if this file ${JENKINS_HOME}/.update_plugin exist!

jenkins_update_plugins

A script to upgrade Jenkins's plugins.

  • It need jenkins-cli.jar.
  • Can also be set in cron.daily to get automatic upgrades.

WordPress

wordpress_cron

A daily cron to check WordPress's Core and plugins updates.

  • It need [wp-cli][wp-cli website] tool.
  • If an update is available, it will create a empty file ({WP_ROOT}/.update_core or {WP_ROOT}/.update_plugin), else it will ensure the "update" files are absents.
    • So, be sure to monitore if the files ${WP_ROOT}/.update_* exists!