GLPI Tools
Features
- Backup of GLPI with retention (Files and SQL)
- Restore from backups
- Update GLPI from official sources
- Fix file permissions
- Easy removal of the installation file after an update
- Backup automation
Usage
Backup GLPI
./glpitools.sh backup
Restore GLPI
./glpitools.sh restore
Update GLPI
./glpitools.sh update
Fix permissions
./glpitools.sh fix-permissions
Remove Install file
./glpitools.sh installfile
Installation and Configuration
Dependencies
apt install curl git
Create directories
mkdir /backup
mkdir /backup/glpi
Download and install glpitools
cd /opt/
git clone https://github.com/goronu/glpitools
cd ./glpitools
Configure glpitools
Edit script file
nano glpitools.sh
Set the following parameters:
BACKUP_DIR
# Backup directoryGLPI_DIR
# GLPI installation pathDB_NAME
# Database nameDB_USER
# MySQL/MariaDB userDB_PASS
# MySQL/MariaDB passwordRETENTION_DAYS
# Number of days before old backups are deletedGLPI_DOWNLOAD_URL
# GLPI source URLAPACHE_USER
# Apache/Nginx user (can be www-data, apache, nginx, etc.)
Automate Backups
Open the CRON file:
crontab -e
Add the following line:
0 2 * * * /opt/glpitools/glpitools.sh backup >> /var/log/glpitools_backup.log 2>&1