Skip to content

Commit

Permalink
Update backupAllFiles.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tsurkan-av authored Dec 19, 2024
1 parent 0f7588f commit ebdf476
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua_doc/backupAllFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if ((Test-Path -Path $($pathBackup + $fileSLSBackup) -PathType Leaf) -ne $false)
slsIP=192.168.1.247
tokenSLS="e9d38bedb6412e.....ed9575"
backupPath="/var/backups/$slsIP/$(date +%Y%m%d_%H%M)"
fileSLSBackup=backup_$backupPath.sls
fileSLSBackup=native.backup
mkdir -p $backupPath
# backup all Files
url="$slsIP/api/storage?token=$tokenSLS&path=/"
Expand All @@ -60,7 +60,7 @@ if [[ $(echo $result | jq ".success") = "true" ]]; then
if [[ $(echo $i | jq -c -r ".is_dir") = "false" ]]; then
f=$(echo $i | jq -c -r ".name")
echo $f
curl -o ./$backupPath/$f $url$f 2>/dev/null
curl -o $backupPath/$f $url$f 2>/dev/null
#break
fi
done
Expand All @@ -70,8 +70,8 @@ fi
# native backup
url=$slsIP/api/backup
get="token=$tokenSLS&action=create&config=1&zigbee=1"
curl -d $get -o ./$backupPath/$fileSLSBackup $url 2>/dev/null
if [ -f "./$backupPath/$fileSLSBackup" ]; then
curl -d $get -o $backupPath/$fileSLSBackup $url 2>/dev/null
if [ -f "$backupPath/$fileSLSBackup" ]; then
echo $fileSLSBackup
else
echo Error request for native backup: File Not Found
Expand Down

0 comments on commit ebdf476

Please sign in to comment.