Ich würde gerne das ccu_backup Tool anwenden.
Rufe ich alle Befehle einzeln auf, funktioniert es wie erwartet
Packe ich die Befehle in eine *.sh Datei, schiebe sie nach /usr/local/addons/makeBackup.sh
gebe ihr 755 Rechte
und rufe sie mit
/usr/local/addons/makeBackup.sh auf
erhalte ich nur Fehlermeldungen:
Code: Alles auswählen
Mounte Dateisystem
mount: mounting //192.168.178.23/disk on /mnt
failed: No such file or directory
Erstelle Backup
/usr/local/addons/makeBackup.sh: line 4: /usr/local/addons/cuxd/extra/ccu_backup
: not found
Kopiere Backup
cp: can't stat '/var/tmp/*.sbk': No such file or directory
Loesche lokale alte Backups lokal
Loesche lokale alte Backups auf mount
find: -exec requires an argument
/usr/local/addons/makeBackup.sh: line 10:
: not found
Unmounte Dateisystem
umount: can't unmount /mnt
: No such file or directory
Fertig.
Code: Alles auswählen
echo "Mounte Dateisystem"
mount -t cifs -o sec=ntlm,vers=1.0,username=xxx,password=xxx//192.168.178.44/disk /mnt
echo "Erstelle Backup"
/usr/local/addons/cuxd/extra/ccu_backup
echo "Kopiere Backup"
cp /var/tmp/*.sbk /mnt/Backup_CCU3
echo "Loesche lokale alte Backups lokal"
rm -rf /var/tmp/*.sbk
echo "Loesche lokale alte Backups auf mount"
find /mnt/Backup_CCU3 -name "*.sbk" -mtime +365 -exec rm -f {} ;
echo "Unmounte Dateisystem"
umount /mnt
echo "Fertig."
Unter Windows würde ich sagen, da Skript geht von einem anderen Wurzelverzeichnis aus. Aber die sind in dem File doch alle absolut refrenziert?!
Wahrscheinlich übersehe ich etwas total naheliegendes, aber ich komm nicht drauf.