scripts/README.md

63 lines
2.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ipr_scripts
#### Table of Contents
1. [Overview](#overview)
2. [Scripts](#scripts)
* [Proxmox](#proxmox)
* [Grav](#grav)
* [Sesame2mail](#sesame2mail)
* [WordPress](#wordpress)
## Overview
Some usefull scripts for admin or users.
## Scripts
### Proxmox
#### vzdump-hook-lxc-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:
* Remove the templates oldest than 2 days (by default).
* Copy the current dump as a template in **/mnt/zfsbkp/template/cache** (by default).
2. 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-template.pl**.
3. Customization:
* If you don't store template in the default path (**/mnt/zfsbkp/template/cache**), please edit the variable **$TEMPLATE_DIR** in the script.
### Grav
#### grav_cron
A daily cron to check if [Grav][grav website] 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.
[grav website]: https://getgrav.org/
### 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.
### WordPress
#### wordpress_cron
A daily cron to check [WordPress][wordpress website]'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!
[wordpress website]: https://wordpress.org/
[wp-clie website]: https://make.wordpress.org/cli/handbook/installing/