Fix directory /data/backups
parent
b139fa16a3
commit
6dd2433b20
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
### Fixed
|
||||
- Resolved issues with fetching available tags when no snapshots existed in the repository, ensuring consistent script behavior.
|
||||
- Fixed a missing password issue when executing `restic -r /mnt/backups snapshots --json`, ensuring `RESTIC_PASSWORD` is securely passed in all cases.
|
||||
- Fixed a missing password issue when executing `restic -r /data/backups snapshots --json`, ensuring `RESTIC_PASSWORD` is securely passed in all cases.
|
||||
- Corrected formatting and display of available tags to ensure no duplicate or unnecessary entries are shown.
|
||||
|
||||
### Updated
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ actions:
|
|||
# Remove script directory
|
||||
- rm -rf "${globals.scriptPath}"
|
||||
# Remove backup repository completely
|
||||
- rm -rf /mnt/backups
|
||||
- rm -rf /data/backups
|
||||
# Remove password file
|
||||
- rm -f /etc/restic-password
|
||||
# Remove log rotation config
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ Displays current backup-related cron jobs and automation status.
|
|||
The following environment variables are used by the scripts:
|
||||
|
||||
- `RESTIC_PASSWORD`: Stored in `/etc/restic-password`
|
||||
- `RESTIC_REPOSITORY`: Default path `/mnt/backup`
|
||||
- `RESTIC_REPOSITORY`: Default path `/data/backups`
|
||||
|
||||
### Log File Locations
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ COMMAND="$2"
|
|||
|
||||
# Set dynamic configurations based on ENV_NAME
|
||||
LOG_FILE="/var/log/${ENV_NAME}_backup_script.log"
|
||||
BACKUP_REPO_PATH="/mnt/backups/${ENV_NAME}"
|
||||
BACKUP_REPO_PATH="/data/backups/${ENV_NAME}"
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOCK_FILE="/tmp/restic_global.lock"
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ function run() {
|
|||
envName : "${envName}",
|
||||
envAppid : "${envAppid}",
|
||||
backupCount : "${backupCount}",
|
||||
backupPath : "/mnt/backup"
|
||||
backupPath : "/data/backups"
|
||||
});
|
||||
|
||||
api.local.ReturnResult(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ CUSTOM_LABEL="$2"
|
|||
|
||||
# Configuration
|
||||
APP_PATH="/var/www/webroot/ROOT"
|
||||
BACKUP_PATH="/mnt/backups"
|
||||
BACKUP_PATH="/data/backups"
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOG_DIR="/home/jelastic/mb-backups/logs"
|
||||
LOG_FILE="${LOG_DIR}/backup_core_files_$(date +'%Y-%m-%d').log"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ CUSTOM_TAG="$2"
|
|||
# Configuration
|
||||
APP_PATH='/var/www/webroot/ROOT'
|
||||
WP_CONFIG="${APP_PATH}/wp-config.php"
|
||||
BACKUP_PATH='/mnt/backups'
|
||||
BACKUP_PATH='/data/backups'
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOG_DIR="/home/jelastic/mb-backups/logs"
|
||||
LOG_FILE="${LOG_DIR}/backup_database_$(date +'%Y-%m-%d').log"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ CUSTOM_TAG="$2"
|
|||
|
||||
# Configuration
|
||||
APP_PATH='/var/www/webroot/ROOT'
|
||||
BACKUP_PATH='/mnt/backups'
|
||||
BACKUP_PATH='/data/backups'
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOG_DIR="/home/jelastic/mb-backups/logs/manual/media"
|
||||
LOG_FILE="${LOG_DIR}/backup_media_$(date +'%Y-%m-%d').log"
|
||||
|
|
@ -66,7 +66,7 @@ else
|
|||
log "No stale locks found."
|
||||
fi
|
||||
|
||||
# Check and fix permissions on /mnt/backups
|
||||
# Check and fix permissions on /data/backups
|
||||
if [ ! -w "$BACKUP_PATH/locks" ]; then
|
||||
log "Fixing permissions on $BACKUP_PATH/locks"
|
||||
sudo chown -R litespeed:litespeed "$BACKUP_PATH/locks"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
set -e
|
||||
|
||||
# Configuration
|
||||
BACKUP_REPO_PATH="/mnt/backups"
|
||||
BACKUP_REPO_PATH="/data/backups"
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOG_FILE="/var/log/backup_repo_check.log"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
set -e
|
||||
|
||||
# Configuration
|
||||
BACKUP_REPO_PATH="/mnt/backups"
|
||||
BACKUP_REPO_PATH="/data/backups"
|
||||
PASSWORD_FILE="/etc/restic-password"
|
||||
LOG_DIR="/home/litespeed/mb-backups/logs"
|
||||
LOG_FILE="${LOG_DIR}/repo_stats_$(date +'%Y-%m-%d').log"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fi
|
|||
# Assign input to variables
|
||||
SNAPSHOT_ID=$1
|
||||
RESTIC_PASSWORD_FILE="/etc/restic-password"
|
||||
RESTIC_REPOSITORY="/mnt/backups"
|
||||
RESTIC_REPOSITORY="/data/backups"
|
||||
LOG_DIR="/home/jelastic/mb-backups/logs/restore"
|
||||
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ fi
|
|||
# Assign input to variables
|
||||
BACKUP_SESSION_TAG="$1"
|
||||
RESTIC_PASSWORD_FILE="/etc/restic-password"
|
||||
RESTIC_REPOSITORY="/mnt/backups"
|
||||
RESTIC_REPOSITORY="/data/backups"
|
||||
LOG_DIR="/home/jelastic/mb-backups/logs/restore"
|
||||
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"
|
||||
TEMP_VALIDATION_DIR="/tmp/full_backup_validation_$$"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
backupPath='/mnt/backups'
|
||||
backupPath='/data/backups'
|
||||
password_file="/etc/restic-password"
|
||||
LOG_DIR="$HOME/mb-backups/logs"
|
||||
LOG_FILE="${LOG_DIR}/backup_sessions.log"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
backupPath='/mnt/backups'
|
||||
backupPath='/data/backups'
|
||||
password_file="/etc/restic-password"
|
||||
LOG_DIR="$HOME/mb-backups/logs"
|
||||
LOG_FILE="${LOG_DIR}/restic_snapshot.log"
|
||||
|
|
|
|||
|
|
@ -25,21 +25,21 @@ chmod 644 /etc/restic-password
|
|||
|
||||
# Create directories
|
||||
echo "[INSTALL] Creating directories..."
|
||||
mkdir -p /mnt/backups
|
||||
mkdir -p /data/backups
|
||||
mkdir -p /home/litespeed/mb-backups/logs
|
||||
chmod -R 755 /home/litespeed/mb-backups/logs
|
||||
chmod 755 /mnt/backups
|
||||
chmod 755 /data/backups
|
||||
|
||||
# Initialize repository
|
||||
echo "[INSTALL] Initializing repository..."
|
||||
export RESTIC_PASSWORD=$(cat /etc/restic-password)
|
||||
export RESTIC_REPOSITORY=/mnt/backups
|
||||
export RESTIC_REPOSITORY=/data/backups
|
||||
|
||||
if restic snapshots >/dev/null 2>&1; then
|
||||
echo "[INSTALL] Repository already exists and is accessible"
|
||||
else
|
||||
echo "[INSTALL] Initializing new repository..."
|
||||
rm -rf /mnt/backups/* 2>/dev/null || true
|
||||
rm -rf /data/backups/* 2>/dev/null || true
|
||||
restic init
|
||||
echo "[INSTALL] Repository initialized successfully"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function BackupManager(config) {
|
|||
backupType: backupType,
|
||||
session: session,
|
||||
email: user.email,
|
||||
backupPath: "/mnt/backup" // Direct path to mounted backup storage
|
||||
backupPath: "/data/backups" // Direct path to mounted backup storage
|
||||
};
|
||||
|
||||
return me.exec([
|
||||
|
|
@ -395,7 +395,7 @@ function BackupManager(config) {
|
|||
me.backup_wp_core = function () {
|
||||
var backupCallParams = {
|
||||
envName: config.envName,
|
||||
backupPath: "/mnt/backup", // Direct path to mounted backup storage
|
||||
backupPath: "/data/backups", // Direct path to mounted backup storage
|
||||
baseUrl: config.baseUrl,
|
||||
backupType: "wp_core",
|
||||
backupLogFile: "/var/log/backup_addon.log",
|
||||
|
|
@ -414,7 +414,7 @@ function BackupManager(config) {
|
|||
me.backup_uploads = function () {
|
||||
var backupCallParams = {
|
||||
envName: config.envName,
|
||||
backupPath: "/mnt/backup", // Direct path to mounted backup storage
|
||||
backupPath: "/data/backups", // Direct path to mounted backup storage
|
||||
baseUrl: config.baseUrl,
|
||||
backupType: "wp_core",
|
||||
backupLogFile: "/var/log/backup_addon.log",
|
||||
|
|
@ -433,7 +433,7 @@ function BackupManager(config) {
|
|||
me.backup_database = function () {
|
||||
var backupCallParams = {
|
||||
envName: config.envName,
|
||||
backupPath: "/mnt/backup", // Direct path to mounted backup storage
|
||||
backupPath: "/data/backups", // Direct path to mounted backup storage
|
||||
baseUrl: config.baseUrl,
|
||||
backupType: "wp_core",
|
||||
backupLogFile: "/var/log/backup_addon.log",
|
||||
|
|
|
|||
Loading…
Reference in New Issue