Mutual GNU / Linux


uiWebPrevious1uiWebNext

#1 [en] 

Hey,

it would be awesome if someone could translate this simple backup script to a working script on Windows or/and Mac and post it here.
Thanks a lot!

https://de.wiki.ryzom.com/wiki/Benutzer:Heernis/Profil-Sicherung

Last edited by Heernis (5 years ago)

---

Nicht klicken!


#2 [en] 

Hm, with WinRAR under Windows it is something like...
Draft
REM Ryzom files backup script
echo off

REM Settings
set SRC="C:\User\LOGIN\PATH\TO\FILES"
set DST="X:\PATH\TO\STORE\BACKUPS"
set LEVEL="5"

REM Execution
echo "Starting backup commands..."
"C:\Program Files\WinRAR\Rar.exe" a -ag -m%LEVEL% %DST%\ryzom_backup-.rar %SRC%

REM Done
echo "Done!"
echo on
Please note I didn't test the script, it is just a draft. I had to write a backup script some time ago (that's why WinRAR but it is similar with any compress tool having command line options). But I am not any Windows user. Also no idea where user files for Ryzom client are stored, I would guess in users home directory somewhere (I am sure you can find this information here on forum :)).

#3 [en] 

Mac Script
#!/bin/bash
# Erstellt von Heernis
# Sicherung des Ryzom Profils
# Letzte Aktualisierung 30.03.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.

TODAY=$(date +%Y-%m-%d-%H:%M:%S)
MONTH=$(date +%Y-%m)

#Verzeichnisse
DIR1="/data/ryzom_profile_backup" #Verzeichnis wohin gesichert wird
DIR2="/Users/$USER/Library/Application Support/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& quot; #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

#Komprimierungslevel
LEVEL="9" #Möglich ist 9 für Ultra bis 1 für Minimal

echo "Starte Sicherung...."
echo " "

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

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

# Ryzom Profil Sicherung
if [ ! -f $DIR1/Ryzom-$MONTH.7z ];
then
echo "Ryzom - Erstelle monatliche Sicherung."
7za a "$DIR1/Ryzom-$MONTH.7z" "$DIR2" -mx=$LEVEL $EXCLUDE1 $EXCLUDE2 $EXCLUDE3 $EXCLUDE4 $EXCLUDE5 $EXCLUDE6 $EXCLUDE7
else
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
fi
echo
echo "Fertig!"

Last edited by Siela (5 years ago)

---



#4 [en] 

Finally i got it working. Windows Batch is really a pain if you use Linux.
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\"
REM Komprimierungslevel 1(minimal)-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 seit 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

https://de.wiki.ryzom.com/wiki/Benutzer:Heernis/Profil-Sicherung# Windows_Script

Thanks Siela for the easy solution ;-)

Thanks Moniq for the inspiration ;-)

Anyone is able to test the script on Windows 10? I used only Windows 7. Thank you!

---

Nicht klicken!


#5 [en] 

Here is the final Version 1:

Wiki Page

Download ZIP
Download TAR.LZMA

Last edited by Heernis (5 years ago)

---

Nicht klicken!


uiWebPrevious1uiWebNext
 
Last visit Thursday, 28 March 23:38:18 UTC
P_:

powered by ryzom-api