Selaa lähdekoodia

20250131 minor edits

lc 1 vuosi sitten
vanhempi
commit
fe3eae0877
5 muutettua tiedostoa jossa 49 lisäystä ja 2 poistoa
  1. 1 0
      .env
  2. 12 1
      backup_volumes.sh
  3. 9 0
      docker-compose.yml
  4. 1 1
      restore_volumes.sh
  5. 26 0
      scripts/diffd.sh

+ 1 - 0
.env

@@ -2,6 +2,7 @@ MYSQL_ROOT_PASSWORD=2eqQ6Rqs
 MYSQL_PASSWORD=123456
 CONTAINER_NAME=nc4
 NEXTCLOUD_HOST=https://1984.algometic.com
+USERROOT_LARRY=/media/yaye/nextcloud_files/apex/larry
 USERROOT_MICHELLE=/media/yaye/nextcloud_files/apex/michellechanpl
 USERROOT_JENNIFER=/media/yaye/nextcloud_files/apex/jennifer.pui
 USERROOT_MINDY=/media/yaye/nextcloud_files/apex/mindy.lui

+ 12 - 1
backup_volumes.sh

@@ -34,7 +34,18 @@
 #    Outputs Status:
 #        The script provides status messages for each step, including skipped volumes, successful backups, and any errors encountered.
 #
-
+#    WARNING:
+#	verify assigned values for these variables before proceeding:
+#
+#           BACKUP_DIR - verify the location is accessible. The mount point is named by the login user so it may look different 
+#           VOLUMES    - are all the volumes to backup include in the list? 
+#                        <volume>_nc4_files: stores the core admin account and binaries, config of next cloud
+#                        <volume>_oo_data: document server
+#                        <volume>_es_index: elastic search index files 
+#                        <volume>_db: mariadb - nextcloud db 
+#                        <volume>_clamav: antivirus defintions          
+#
+#
 # Variables
 BACKUP_DIR="/media/yaye/nextcloud_files/backup/nc2/docker_volumes"  # Change this to your desired backup directory
 TIMESTAMP=$(date +"%Y%m%d_%H%M%S")

+ 9 - 0
docker-compose.yml

@@ -2,6 +2,14 @@ version: '3'
 
 volumes:
 
+  files_larry:
+    name: ${CONTAINER_NAME}_files_larry
+    driver: local
+    driver_opts:
+      type: volume
+      o: 'bind'
+      device: ${USERROOT_LARRY} 
+
   files_michelle:
     name: ${CONTAINER_NAME}_files_michelle
     driver: local
@@ -97,6 +105,7 @@ services:
       - files_mindy:/var/www/html/data/mindy
       - files_jennifer:/var/www/html/data/jennifer
       - files_michelle:/var/www/html/data/michelle
+      - files_larry:/var/www/html/data/larry
     restart: "no" 
     environment:
       - REDIS_HOST=redis

+ 1 - 1
restore_volumes.sh

@@ -37,7 +37,7 @@
 
 # Variables
 BACKUP_DIR="/media/yaye/nextcloud_files/backup/nc2/docker_volumes"  # Change this to your desired backup directory
-TIMESTAMP="20250128_225505"  # Replace with your desired timestamp
+TIMESTAMP="20250131_174358"  # Replace with your desired timestamp
 
 
 # List of volumes to restore

+ 26 - 0
scripts/diffd.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Check if two directories are provided as arguments
+if [ $# -ne 2 ]; then
+  echo "Usage: $0 <dir1> <dir2>"
+  exit 1
+fi
+
+# Set directory variables
+DIR1=$1
+DIR2=$2
+
+# Check if directories exist
+if [ ! -d "$DIR1" ]; then
+  echo "Directory $DIR1 does not exist"
+  exit 1
+fi
+
+if [ ! -d "$DIR2" ]; then
+  echo "Directory $DIR2 does not exist"
+  exit 1
+fi
+
+# Use diff to compare directory contents
+echo "Comparing directory contents:"
+diff -rq "$DIR1" "$DIR2"