===== Startscipte erstellen =====
* [[https://github.com/OneCDOnly/create-autorun/tree/main|create your autorun.sh]]
* [[https://forum.qnapclub.de/thread/45028-script-autorun-sh-erstellen-von-start-und-stopp-scripten/?pageNo=1|Erstellen von Start- und Stopp-Scripten]]
Die autorun.sh liegt unter:
/share/CACHEDEV1_DATA/.system/autorun/autorun.sh
#!/usr/bin/env bash
# source: https://github.com/OneCDOnly/create-autorun
readonly LOGFILE=/var/log/autorun.log
f=''
echo "$(date) -- begin processing --" >> "$LOGFILE"
for f in /share/CACHEDEV1_DATA/.system/autorun/scripts/*; do
if [[ -x $f ]]; then
echo -n "$(date)" >> "$LOGFILE"
echo " executing $f ..." >> "$LOGFILE"
$f >> "$LOGFILE" 2>&1
fi
done
echo "$(date) -- end processing --" >> "$LOGFILE"
Die Scripte werden abgelegt unter:
/share/CACHEDEV1_DATA/.system/autorun/scripts/
Die Reiehnfolge der Scripts kann wie folgt festgelegt werden:
- 10-example.sh
- 20-example.sh
- 25-example.sh
- 30-example.sh
Eine Logdatei liegt unter:
/var/log/autorun.log