Benutzer:Heernis/Profil-Sicherung: Unterschied zwischen den Versionen

Aus EnzyklopAtys

Wechseln zu: Navigation, Suche
K (Windows Script)
K (Linux Script)
Zeile 5: Zeile 5:
 
# Erstellt von Heernis
 
# Erstellt von Heernis
 
# Sicherung des Ryzom Profils
 
# Sicherung des Ryzom Profils
# Letzte Aktualisierung 30.03.2019
+
# Letzte Aktualisierung 02.04.2019
 
# Benötigt wird: sudo apt install p7zip-full
 
# Benötigt wird: sudo apt install p7zip-full
 
# Das Script erstellt bei Ausführung ein monatliche Sicherung.  
 
# Das Script erstellt bei Ausführung ein monatliche Sicherung.  
Zeile 11: Zeile 11:
 
# das nur Veränderungen im Bezug auf die letzte monatliche Sicherung, erstellt.
 
# das nur Veränderungen im Bezug auf die letzte monatliche Sicherung, erstellt.
 
# Große Dateien, wie Musik, Mods oder Screenshots, können per Exclude-Variabel ausgelassen werden.
 
# Große Dateien, wie Musik, Mods oder Screenshots, können per Exclude-Variabel ausgelassen werden.
 +
mytitle="Profil-Sicherung"
  
TODAY=$(date +%Y-%m-%d-%H:%M:%S)
+
DAILY=$(date +%Y-%m-%d-%H:%M:%S)
MONTH=$(date +%Y-%m)
+
FULL=$(date +%Y-%m)
 
 
#Verzeichnisse
 
DIR1="/data/ryzom_profile_backup" #Verzeichnis wohin gesichert wird
 
DIR2="/home/$USER/.local/share/Ryzom" #Verzeichnis der Ryzom Profile
 
 
 
#Ausgeschlossene Verzeichnisse und Dateien
 
#EXCLUDE0="-xr!/home/$USER/.local/share/Ryzom/mods" #Modifikationen auslassen
 
#EXCLUDE1="-xr!/home/$USER/.local/share/Ryzom/0/music" #Musik im Profil 0 auslassen
 
#EXCLUDE2="-xr!/home/$USER/.local/share/Ryzom/0/screenshots" #Bildschirmaufnahmen im Profil 0 auslassen
 
 
 
#EXCLUDE3="-xr!*.tga -xr!*.png -xr!*.jpeg -xr!*.jpg -xr!*.gif" #Alle Bilder auslassen
 
#EXCLUDE4="-xr!*.mp3 -xr!*.ogg -xr!*.wav" #Alle Audio-Dateien auslassen
 
 
 
#EXCLUDE5="-xr!*.dds -xr!*.shape -xr!*.anim -xr!*.ps -xr!*.anim" #Alle Modifikationen auslassen
 
 
 
#EXCLUDE6="-xr!*.cache -xr!*.index -xr!*.string_client.pack -xr!*.string_cache -xr!hsts-list.save" #Cache auslassen
 
#EXCLUDE7="-xr!*.dmg -xr!*.log" #Log und Debug auslassen
 
  
 +
#Einstellungen
 +
NAME="Ryzom"
 +
OS="Linux"
 +
SRC="/home/$USER/.local/share/Ryzom" #Verzeichnis der Ryzom Profile
 +
DST="/home/$USER/ryzom_profile_backup" #Verzeichnis wohin gesichert wird
 
#Komprimierungslevel
 
#Komprimierungslevel
 
LEVEL="9" #Möglich ist 9 für Ultra bis 1 für Minimal
 
LEVEL="9" #Möglich ist 9 für Ultra bis 1 für Minimal
 +
#Architektur wählen
 +
#ARCH="linux/x86/lib/p7zip"
 +
#ARCH="linux/x64/lib/p7zip"
  
echo "Starte Sicherung...."
+
#EX_PICTURES="-xr!*.tga -xr!*.png -xr!*.jpeg -xr!*.jpg -xr!*.gif" #Alle Bilder auslassen
echo " "
+
#EX_AUDIO="-xr!*.mp3 -xr!*.ogg -xr!*.wav" #Alle Audio-Dateien auslassen
 +
#EX_MOD="-xr!*.dds -xr!*.shape -xr!*.anim -xr!*.ps -xr!*.anim" #Alle Modifikationen auslassen
 +
#EX_CACHE="-xr!*.cache -xr!*.index -xr!*.string_client.pack -xr!*.string_cache -xr!hsts-list.save" #Cache auslassen
 +
#EX_DEBUG="-xr!*.dmg -xr!*.log" #Log und Debug auslassen
  
 
#Lösche alle Cache-Dateien (optional). Entferne #, wenn gewünscht.  
 
#Lösche alle Cache-Dateien (optional). Entferne #, wenn gewünscht.  
#find $DIR2 -type f -name '*.cache' -exec rm {} \;
+
#find $SRC -type f -name '*.cache' -exec rm {} \;
#find $DIR2 -type f -name 'cache.index' -exec rm {} \;
+
#find $SRC -type f -name 'cache.index' -exec rm {} \;
#find $DIR2 -type f -name 'string_client.pack' -exec rm {} \;
+
#find $SRC -type f -name 'string_client.pack' -exec rm {} \;
#find $DIR2 -type f -name '*.string_cache' -exec rm {} \;
+
#find $SRC -type f -name '*.string_cache' -exec rm {} \;
#find $DIR2 -type f -name 'hsts-list.save' -exec rm {} \;
+
#find $SRC -type f -name 'hsts-list.save' -exec rm {} \;
  
 
#Lösche Log und Debug Dateien (optional). Entferne #, wenn gewünscht.  
 
#Lösche Log und Debug Dateien (optional). Entferne #, wenn gewünscht.  
#find $DIR2 -type f -name '*.log' -exec rm {} \;
+
#find $SRC -type f -name '*.log' -exec rm {} \;
#find $DIR2 -type f -name '*.dmg' -exec rm {} \;
+
#find $SRC -type f -name '*.dmg' -exec rm {} \;
 +
 
 +
# 7za ausführbar machen
 +
chmod +x linux/x86/lib/p7zip/7za
 +
chmod +x linux/x64/lib/p7zip/7za
  
 
# Ryzom Profil Sicherung
 
# Ryzom Profil Sicherung
if [ ! -f $DIR1/Ryzom-$MONTH.7z ];
+
echo "Starte Sicherung...."
 +
echo " "
 +
if [ ! -f $DST/$NAME-$OS_$FULL.7z ];
 
then
 
then
 
echo "Ryzom - Erstelle monatliche Sicherung."
 
echo "Ryzom - Erstelle monatliche Sicherung."
7za a $DIR1/Ryzom-$MONTH.7z $DIR2 -mx=$LEVEL $EXCLUDE1 $EXCLUDE2 $EXCLUDE3 $EXCLUDE4 $EXCLUDE5 $EXCLUDE6 $EXCLUDE7
+
$ARCH/7za a $DST/$NAME-$OS_$FULL.7z $SRC -mx=$LEVEL $EX_PICTURES $EX_AUDIO $EX_MOD $EX_CACHE $EX_DEBUG
fi$EXCLUDE3
 
 
else
 
else
 
echo "Ryzom - Erstelle aktuelle Sicherung."
 
echo "Ryzom - Erstelle aktuelle Sicherung."
7za u $DIR1/Ryzom-$MONTH $DIR2 -ms=off -mx=$LEVEL -t7z -u- -up0q3r2x2y2z0w2!$DIR1/Ryzom-$TODAY.7z $EXCLUDE1 $EXCLUDE2 $EXCLUDE3 $EXCLUDE4 $EXCLUDE5 $EXCLUDE6 $EXCLUDE7
+
$ARCH/7za u $DST/$NAME-$OS_$FULL.7z $SRC -ms=off -mx=$LEVEL -t7z -u- -up0q3r2x2y2z0w2!$DST/$NAME-$OS_$DAILY.7z $EX_PICTURES $EX_AUDIO $EX_MOD $EX_CACHE $EX_DEBUG
 
fi
 
fi
 
echo
 
echo

Version vom 2. April 2019, 22:33 Uhr

Linux Script

#!/bin/bash
# Erstellt von Heernis
# Sicherung des Ryzom Profils
# Letzte Aktualisierung 02.04.2019
# Benötigt wird: sudo apt install p7zip-full
# Das Script erstellt bei Ausführung ein monatliche Sicherung. 
# Wenn ein monatliche Sicherung vorhanden, erstellt es ein inkrementelle Sicherung, 
# das nur Veränderungen im Bezug auf die letzte monatliche Sicherung, erstellt.
# Große Dateien, wie Musik, Mods oder Screenshots, können per Exclude-Variabel ausgelassen werden.
mytitle="Profil-Sicherung"

DAILY=$(date +%Y-%m-%d-%H:%M:%S)
FULL=$(date +%Y-%m)

#Einstellungen
NAME="Ryzom"
OS="Linux"
SRC="/home/$USER/.local/share/Ryzom" #Verzeichnis der Ryzom Profile
DST="/home/$USER/ryzom_profile_backup" #Verzeichnis wohin gesichert wird
#Komprimierungslevel
LEVEL="9" #Möglich ist 9 für Ultra bis 1 für Minimal
#Architektur wählen
#ARCH="linux/x86/lib/p7zip"
#ARCH="linux/x64/lib/p7zip"

#EX_PICTURES="-xr!*.tga -xr!*.png -xr!*.jpeg -xr!*.jpg -xr!*.gif" #Alle Bilder auslassen
#EX_AUDIO="-xr!*.mp3 -xr!*.ogg -xr!*.wav" #Alle Audio-Dateien auslassen
#EX_MOD="-xr!*.dds -xr!*.shape -xr!*.anim -xr!*.ps -xr!*.anim" #Alle Modifikationen auslassen
#EX_CACHE="-xr!*.cache -xr!*.index -xr!*.string_client.pack -xr!*.string_cache -xr!hsts-list.save" #Cache auslassen
#EX_DEBUG="-xr!*.dmg -xr!*.log" #Log und Debug auslassen

#Lösche alle Cache-Dateien (optional). Entferne #, wenn gewünscht. 
#find $SRC -type f -name '*.cache' -exec rm {} \;
#find $SRC -type f -name 'cache.index' -exec rm {} \;
#find $SRC -type f -name 'string_client.pack' -exec rm {} \;
#find $SRC -type f -name '*.string_cache' -exec rm {} \;
#find $SRC -type f -name 'hsts-list.save' -exec rm {} \;

#Lösche Log und Debug Dateien (optional). Entferne #, wenn gewünscht. 
#find $SRC -type f -name '*.log' -exec rm {} \;
#find $SRC -type f -name '*.dmg' -exec rm {} \;

# 7za ausführbar machen
chmod +x linux/x86/lib/p7zip/7za
chmod +x linux/x64/lib/p7zip/7za

# Ryzom Profil Sicherung
echo "Starte Sicherung...."
echo " "
if [ ! -f $DST/$NAME-$OS_$FULL.7z ];
then
echo "Ryzom - Erstelle monatliche Sicherung."
$ARCH/7za a $DST/$NAME-$OS_$FULL.7z $SRC -mx=$LEVEL $EX_PICTURES $EX_AUDIO $EX_MOD $EX_CACHE $EX_DEBUG
else
echo "Ryzom - Erstelle aktuelle Sicherung."
$ARCH/7za u $DST/$NAME-$OS_$FULL.7z $SRC -ms=off -mx=$LEVEL -t7z -u- -up0q3r2x2y2z0w2!$DST/$NAME-$OS_$DAILY.7z $EX_PICTURES $EX_AUDIO $EX_MOD $EX_CACHE $EX_DEBUG
fi
echo
echo "Fertig!"

Windows Script

@echo off
REM Erstellt von Heernis
REM Sicherung des Ryzom Profils
REM Letzte Aktualisierung 02.04.2019
REM Benötigt wird: 7za.exe 7za.dll 7zxa.dll
REM Das Script erstellt bei Ausführung ein monatliche Sicherung. 
REM Wenn eine monatliche Sicherung vorhanden, erstellt es eine inkrementelle Sicherung, 
REM die nur Veränderungen im Bezug auf die letzte monatliche Sicherung, erstellt.
REM Große Dateien, wie Musik, Mods oder Bildschirmaufnahmen, können per Exclude-Variabel ausgelassen werden.
title Profil-Sicherung

REM Hier nichts verändern!
set day="%date:~0,2%"
set month="%date:~3,2%"
set year="%date:~6,4%"
set hour="%time:~0,2%"
set min="%time:~3,2%"
set sec="%time:~6,2%"
set FULL="%year%-%month%"
set DAILY="%year%-%month%-%day%_%hour%-%min%-%sec%"

REM Einstellungen
set NAME="Ryzom"
set OS="Win7"
set SRC="C:\Users\%username%\AppData\Roaming\Ryzom\"
set DST="C:\Users\%username%\Desktop\ryzom_profile_backup\"
REM Komprimierungslevel 1 [minimal] bis 9 [ultra]
set LEVEL="9"

REM Architektur wählen. Nur eines von beiden darf ohne REM stehen bleiben!
REM set ARCH="win\x86"
set ARCH="win\x64"

REM Alle Bilder auslassen
REM set EXCLUDE1=-xr!*.tga -xr!*.png -xr!*.jpeg -xr!*.jpg -xr!*.gif

REM Alle Audio-Dateien auslassen
REM set EXCLUDE2=-xr!*.mp3 -xr!*.ogg -xr!*.wav

REM Alle Modifikationen auslassen
REM set EXCLUDE3=-xr!*.dds -xr!*.shape -xr!*.anim -xr!*.ps -xr!*.anim
REM Log und Debug auslassen
REM set EXCLUDE4=-xr!*.cache -xr!*.index -xr!*.string_client.pack -xr!*.string_cache -xr!hsts-list.save
REM set EXCLUDE5=-xr!*.dmg -xr!*.log 

REM Lösche alle Cache-Dateien [optional]. Entferne REM, wenn gewünscht. 
REM del "%SRC%*.cache" /s /f /q
REM del "%SRC%*.index" /s /f /q
REM del "%SRC%*.pack" /s /f /q
REM del "%SRC%*.string_cache" /s /f /q
REM del "%SRC%*.save" /s /f /q

REM Lösche Log und Debug Dateien [optional]. Entferne REM, wenn gewünscht. 
REM del "%SRC%*.log" /s /f /q
REM del "%SRC%*.dmg" /s /f /q

REM Ryzom Sicherung
if not exist %DST%\%NAME%-%OS%_%FULL%.7z (
echo Starte monatliche Sicherung
REM 
%ARCH%\7za a %DST%\%NAME%-%OS%_%FULL%.7z %SRC% -mx=%LEVEL% %EXCLUDE0% %EXCLUDE1% %EXCLUDE2% %EXCLUDE3% %EXCLUDE4% %EXCLUDE5%
) else (
echo Erstelle aktuelle Sicherung
%ARCH%\7za u %DST%\%NAME%-%OS%_%FULL%.7z %SRC% -ms=off -mx=%LEVEL% -t7z -u- -up0q3r2x2y2z0w2!%DST%/%NAME%-%OS%_%DAILY%.7z %EXCLUDE0% %EXCLUDE1% %EXCLUDE2% %EXCLUDE3% %EXCLUDE4% %EXCLUDE5%
)
echo Fertig

Download ZIP Download TAR.LZMA