Update /data folder

main
Anthony 2025-07-18 01:25:40 +08:00
parent 6dd2433b20
commit 8ae80c34b1
15 changed files with 20 additions and 22 deletions

View File

@ -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 /data/backups snapshots --json`, ensuring `RESTIC_PASSWORD` is securely passed in all cases.
- Fixed a missing password issue when executing `restic -r /data 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

View File

@ -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 `/data/backups`
- `RESTIC_REPOSITORY`: Default path `/data`
### Log File Locations

View File

@ -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="/data/backups/${ENV_NAME}"
BACKUP_REPO_PATH="/data"
PASSWORD_FILE="/etc/restic-password"
LOCK_FILE="/tmp/restic_global.lock"

View File

@ -13,7 +13,7 @@ function run() {
envName : "${envName}",
envAppid : "${envAppid}",
backupCount : "${backupCount}",
backupPath : "/data/backups"
backupPath : "/data"
});
api.local.ReturnResult(

View File

@ -22,7 +22,7 @@ CUSTOM_LABEL="$2"
# Configuration
APP_PATH="/var/www/webroot/ROOT"
BACKUP_PATH="/data/backups"
BACKUP_PATH="/data"
PASSWORD_FILE="/etc/restic-password"
LOG_DIR="/home/jelastic/mb-backups/logs"
LOG_FILE="${LOG_DIR}/backup_core_files_$(date +'%Y-%m-%d').log"

View File

@ -16,7 +16,7 @@ CUSTOM_TAG="$2"
# Configuration
APP_PATH='/var/www/webroot/ROOT'
WP_CONFIG="${APP_PATH}/wp-config.php"
BACKUP_PATH='/data/backups'
BACKUP_PATH='/data'
PASSWORD_FILE="/etc/restic-password"
LOG_DIR="/home/jelastic/mb-backups/logs"
LOG_FILE="${LOG_DIR}/backup_database_$(date +'%Y-%m-%d').log"

View File

@ -15,7 +15,7 @@ CUSTOM_TAG="$2"
# Configuration
APP_PATH='/var/www/webroot/ROOT'
BACKUP_PATH='/data/backups'
BACKUP_PATH='/data'
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 /data/backups
# Check and fix permissions on /data
if [ ! -w "$BACKUP_PATH/locks" ]; then
log "Fixing permissions on $BACKUP_PATH/locks"
sudo chown -R litespeed:litespeed "$BACKUP_PATH/locks"

View File

@ -4,7 +4,7 @@
set -e
# Configuration
BACKUP_REPO_PATH="/data/backups"
BACKUP_REPO_PATH="/data"
PASSWORD_FILE="/etc/restic-password"
LOG_FILE="/var/log/backup_repo_check.log"

View File

@ -4,7 +4,7 @@
set -e
# Configuration
BACKUP_REPO_PATH="/data/backups"
BACKUP_REPO_PATH="/data"
PASSWORD_FILE="/etc/restic-password"
LOG_DIR="/home/litespeed/mb-backups/logs"
LOG_FILE="${LOG_DIR}/repo_stats_$(date +'%Y-%m-%d').log"

View File

@ -13,7 +13,7 @@ fi
# Assign input to variables
SNAPSHOT_ID=$1
RESTIC_PASSWORD_FILE="/etc/restic-password"
RESTIC_REPOSITORY="/data/backups"
RESTIC_REPOSITORY="/data"
LOG_DIR="/home/jelastic/mb-backups/logs/restore"
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"

View File

@ -18,7 +18,7 @@ fi
# Assign input to variables
BACKUP_SESSION_TAG="$1"
RESTIC_PASSWORD_FILE="/etc/restic-password"
RESTIC_REPOSITORY="/data/backups"
RESTIC_REPOSITORY="/data"
LOG_DIR="/home/jelastic/mb-backups/logs/restore"
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"
TEMP_VALIDATION_DIR="/tmp/full_backup_validation_$$"

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Configuration
backupPath='/data/backups'
backupPath='/data'
password_file="/etc/restic-password"
LOG_DIR="$HOME/mb-backups/logs"
LOG_FILE="${LOG_DIR}/backup_sessions.log"

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Configuration
backupPath='/data/backups'
backupPath='/data'
password_file="/etc/restic-password"
LOG_DIR="$HOME/mb-backups/logs"
LOG_FILE="${LOG_DIR}/restic_snapshot.log"

View File

@ -25,21 +25,19 @@ chmod 644 /etc/restic-password
# Create directories
echo "[INSTALL] Creating directories..."
mkdir -p /data/backups
mkdir -p /home/litespeed/mb-backups/logs
chmod -R 755 /home/litespeed/mb-backups/logs
chmod 755 /data/backups
# Initialize repository
echo "[INSTALL] Initializing repository..."
export RESTIC_PASSWORD=$(cat /etc/restic-password)
export RESTIC_REPOSITORY=/data/backups
export RESTIC_REPOSITORY=/data
if restic snapshots >/dev/null 2>&1; then
echo "[INSTALL] Repository already exists and is accessible"
else
echo "[INSTALL] Initializing new repository..."
rm -rf /data/backups/* 2>/dev/null || true
rm -rf /data/* 2>/dev/null || true
restic init
echo "[INSTALL] Repository initialized successfully"
fi

View File

@ -106,7 +106,7 @@ function BackupManager(config) {
backupType: backupType,
session: session,
email: user.email,
backupPath: "/data/backups" // Direct path to mounted backup storage
backupPath: "/data" // Path to mounted shared storage
};
return me.exec([
@ -395,7 +395,7 @@ function BackupManager(config) {
me.backup_wp_core = function () {
var backupCallParams = {
envName: config.envName,
backupPath: "/data/backups", // Direct path to mounted backup storage
backupPath: "/data", // Path to mounted shared 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: "/data/backups", // Direct path to mounted backup storage
backupPath: "/data", // Path to mounted shared 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: "/data/backups", // Direct path to mounted backup storage
backupPath: "/data", // Path to mounted shared storage
baseUrl: config.baseUrl,
backupType: "wp_core",
backupLogFile: "/var/log/backup_addon.log",