Skip to content

Commit ebdf476

Browse files
authored
Update backupAllFiles.md
1 parent 0f7588f commit ebdf476

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua_doc/backupAllFiles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if ((Test-Path -Path $($pathBackup + $fileSLSBackup) -PathType Leaf) -ne $false)
4949
slsIP=192.168.1.247
5050
tokenSLS="e9d38bedb6412e.....ed9575"
5151
backupPath="/var/backups/$slsIP/$(date +%Y%m%d_%H%M)"
52-
fileSLSBackup=backup_$backupPath.sls
52+
fileSLSBackup=native.backup
5353
mkdir -p $backupPath
5454
# backup all Files
5555
url="$slsIP/api/storage?token=$tokenSLS&path=/"
@@ -60,7 +60,7 @@ if [[ $(echo $result | jq ".success") = "true" ]]; then
6060
if [[ $(echo $i | jq -c -r ".is_dir") = "false" ]]; then
6161
f=$(echo $i | jq -c -r ".name")
6262
echo $f
63-
curl -o ./$backupPath/$f $url$f 2>/dev/null
63+
curl -o $backupPath/$f $url$f 2>/dev/null
6464
#break
6565
fi
6666
done
@@ -70,8 +70,8 @@ fi
7070
# native backup
7171
url=$slsIP/api/backup
7272
get="token=$tokenSLS&action=create&config=1&zigbee=1"
73-
curl -d $get -o ./$backupPath/$fileSLSBackup $url 2>/dev/null
74-
if [ -f "./$backupPath/$fileSLSBackup" ]; then
73+
curl -d $get -o $backupPath/$fileSLSBackup $url 2>/dev/null
74+
if [ -f "$backupPath/$fileSLSBackup" ]; then
7575
echo $fileSLSBackup
7676
else
7777
echo Error request for native backup: File Not Found

0 commit comments

Comments
 (0)