Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

fehler im skript

Empfohlene Antworten

Veröffentlicht

Hi habe mal folgendes versuch


#!/bin/bash


# Variablen

verzeichnis=/mnt/server


# Zu Sichernde Verzeichnisse (array)

array=( public Amt Amt01 Amt02 Amt03 Amt04 Amt05 Amt06 Amt07 Amt08 Amt09 Amt10 Amt11 Amt12 Amt13 Amt14 Amt15 Amt16 Amt17 Amt18 Amt19 Amt20 RPA )

# 1=0 im array

anzahl=22



if [ -d $verzeichnis ]; then

echo "Verzeichnis vorhanden"

else

mkdir $verzeichnis

fi


## smbmount //ntkvbit1/D$ /mnt/server/ -o codepage=cp850,username=administrator,password=blabla

if [ -f $verzeichnis ]; then

echo "Verzeichnis schon gemountet"

else

smbmount //ntkvbit1/D$ /mnt/server/ -o iocharset=iso8859-1 codepage=cp1250,username=administrator,password=blabla

fi


#### REM  Erst die Datenverzeichnisse der Ämter sichern

i=0

while [ $i <= $anzahl ]; do

echo "$i"

#zip -r -1 -q -u daten.${array[i]}.zip /mnt/server/Daten/${array[i]}

i=$i+1

done

was mache ich falsch?

Gruß

debitux :-)

Originally posted by debitux

Hi habe mal folgendes versuch



#!/bin/bash


# Variablen

verzeichnis=/mnt/server


# Zu Sichernde Verzeichnisse (array)

array=( public Amt Amt01 Amt02 Amt03 Amt04 Amt05 Amt06 Amt07 Amt08 Amt09 Amt10 Amt11 Amt12 Amt13 Amt14 Amt15 Amt16 Amt17 Amt18 Amt19 Amt20 RPA )

# 1=0 im array

anzahl=22



if [ -d $verzeichnis ]; then

echo "Verzeichnis vorhanden"

else

mkdir $verzeichnis

fi


## smbmount //ntkvbit1/D$ /mnt/server/ -o codepage=cp850,username=administrator,password=blabla

if [ -f $verzeichnis ]; then

echo "Verzeichnis schon gemountet"

else

smbmount //ntkvbit1/D$ /mnt/server/ -o iocharset=iso8859-1 codepage=cp1250,username=administrator,password=blabla

fi


#### REM  Erst die Datenverzeichnisse der Ämter sichern

i=0

while [ $i <= $anzahl ]; do

echo "$i"

#zip -r -1 -q -u daten.${array[i]}.zip /mnt/server/Daten/${array[i]}

i=$i+1

done

was mache ich falsch?

Gruß

debitux :-)

Hi :)

Nun sollte man wissen was nicht funktioniert?

Schonmal nachgeschaut ob er auch richtig mountet?

Wenn nicht probier es mal so

mount -t smbfs -o username=administrator,password=blabla //ntkvbit1/D$ /mnt/server/ /mnt/Server

gruß

play

Jo der mountet richtig :-) Der Fehler liegt in der while schleife. Ich weiß aber nicht was falsch ist daran... Will nur wissen wie das hochzählen richitg funzt.

Gruß

debitux :-)

Das Skript funzt jetzt :-) Hab die Fehler gefunden.


#!/bin/bash


############

# Variablen#

############


# Samba User/Passwort

user=""

passwd=""


# Mountpunkt

verzeichnis=


# Unterverzeichnisse

ver1=

ver2=


# Zu Sichernde Verzeichnisse (array)

ver1a=( public Amt Amt01 Amt02 Amt03 Amt04 Amt05 Amt06 Amt07 Amt08 Amt09 Amt10 Amt11 Amt12 Amt13 Amt14 Amt15 Amt16 Amt17 Amt18 Amt19 Amt20 RPA )

ver2a=( Amt01 Amt02 Amt03 Amt04 Amt05 Amt06 Amt07 Amt08 Amt09 Amt10 Amt11 Amt12 Amt13 Amt14 Amt15 Amt16 Amt17 Amt18 Amt19 Amt20 RPA )


# 1=0 im array

aver1=22

aver2=21


# zip Optionen 

option="-r -1 -q -u"

######################################################

######################################################


# Verzeichnis schon da?

if [ -d $verzeichnis ]; then

echo "Verzeichnis vorhanden"

else

mkdir $verzeichnis

fi


# Freigabe schon gemountet?

#if [ -d $verzeichnis ]; then

#echo "Verzeichnis schon gemountet"

#else

smbmount //ntkvbit1/D$ /mnt/NTKVBIT1D/ -o codepage=cp1250,username=$user,password=$passwd

#fi


# Datenverzeichnisse der Ämter sichern

i=0

while [ $i -le $aver1 ]; do

echo "Sichere: "${ver1a[i]}

zip $option daten.${ver1a[i]}.zip $verzeichnis$ver1${ver1a[i]}

i=$((i+1))

done


# Programm-Verzeichnisse der Ämter sichern

i=0

while [ $i -le $aver2 ]; do

echo "Sichere: "${ver2a[i]}

zip $option programm.${ver2a[i]}.zip $verzeichnis$ver2${ver2a[i]}

i=$((i+1))

done


umount $verzeichnis 


# EOF

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.