Flash belastung durch cron

    • Flash belastung durch cron

      Hi,
      aufgrund einiger Probleme mit meiner eSATA verbindung zur Dreambox bin ich derzeit erst mal wieder auf mein NAS ausgewichen. Das NAS, ne Buffalo Linkstation Live 1TB, verfügt über einen "Auto-Modus" der das NAS nach 3 min abschaltet sofern es kein Magic Packet empfängt. Soweit, sogut... ich habe nun einen cronjob eingerichtet der unten aufgeführtes Script alle 2 min ausführt. In wie weit belastet denn ein solches Script eigentlich den Flash Baustein der Box. Ich war immer der Meinung das nur eine begrenzte Anzahl von Lese/Schreibvorgängen auf so einem Flash Speicher möglich ist und wenn dem so wäre dann würde es die Lebenserwartung des Chips drastisch senken wenn ein Script alle 2 min einen Zugriff startet.

      Shell-Script

      1. #!/bin/sh
      2. #
      3. SERVERNAME=10.0.0.1
      4. MOUNTPOINT=/media/net/NAS
      5. SERVERSHARE=//10.0.0.1/dreamhdd
      6. UN=username
      7. PW=password
      8. NOW=`date +%s`
      9. ## dirty check for standby
      10. if [ "$(cat /proc/stb/avs/0/input | grep encoder)" ]
      11. then
      12. ## send a magic packet to wakeup/keep alive the NAS always
      13. echo "Dreambox not in Standby! -> send WOL Package to NAS"
      14. python /usr/script/nas-wol.py
      15. ## check if the mountpoint is already mounted
      16. if [ "$(df | grep $SERVERSHARE)" ];
      17. then
      18. ## if so ... do nothing and exit
      19. echo "$MOUNTPOINT already mounted -> exit(0)"
      20. exit 0
      21. else
      22. ## if not ... try to mount the share
      23. echo -n "$MOUNTPOINT not mounted -> trying to mount "
      24. mount -t cifs $SERVERSHARE $MOUNTPOINT -o username=$UN,password=$PW,rw
      25. ## report results
      26. if [ "$(df | grep $SERVERSHARE)" ]
      27. then
      28. echo "-> success"
      29. exit 0
      30. else
      31. echo "-> failed"
      32. exit 1
      33. fi
      34. fi
      35. else
      36. echo "Dreambox is in Standby!"
      37. ## check if the timers.xml is empty.... (size of 42 Bytes)
      38. if [ "$(ls -l /etc/enigma2/timers.xml | grep 42)" ]
      39. then
      40. echo "/etc/enigma2/timers.xml is empty -> exit(0)"
      41. exit 0
      42. else
      43. ## check if timers.xml exists
      44. if [ "$(ls /etc/enigma2 | grep timers.xml)" ]
      45. then
      46. ## if so ... check the upcoming timers to start in $TRESHOLD seconds (600 = 10 min)
      47. COUNT=0
      48. TIMER=/etc/enigma2/timers.xml
      49. THRESHOLD=600
      50. TIMERBEGINS=`grep begin $TIMER |sed 's/.*begin="//' | sed 's/".*//'`
      51. echo "Check for upcoming timers..."
      52. for START in $TIMERBEGINS
      53. do
      54. echo -n "Timer: $START, "
      55. # diff is timer start time - current time
      56. DIFF=$(($START-$NOW))
      57. echo "Diff to now: $DIFF"
      58. # if diff is greater 0 then the timer has not been processed yet
      59. if [ $DIFF -gt 0 ]
      60. then
      61. echo "Timer is not processed yet."
      62. # if diff is less then $TRESHOLD then the timer will start soon
      63. if [ $DIFF -le $THRESHOLD ]
      64. then
      65. echo -n "Timer is starting soon -> wakeup Dreambox from Standby "
      66. wget -q -O- http://127.0.0.1/web/powerstate?newstate=0
      67. echo "-> send WOL to NAS"
      68. python /usr/script/nas-wol.py
      69. fi
      70. else
      71. # count the processed timers here
      72. echo "Timer already processed."
      73. COUNT=$(( $COUNT + 1 ))
      74. fi
      75. done
      76. # if there are processed timers in list we do a cleanup
      77. # timers.xml will then have size 42 again if empty
      78. if [ $COUNT -gt 0 ]
      79. then
      80. echo "Timer cleanup..."
      81. wget -q -O- http://127.0.0.1/web/timercleanup?cleanup=true
      82. wget -q -O- http://127.0.0.1/web/timerlistwrite?write=true
      83. fi
      84. else
      85. echo "timers.xml does not exist."
      86. exit 1
      87. fi
      88. fi
      89. fi
      Alles anzeigen
    • Soweit ich weiß ist in den Boxen SLC NAND verbaut der übersteht im kommerziellen Bereich gute 100.000 Schreibzyklen pro Zelle.

      Ist eine Zelle abgenutzt so wird sie als bad markiert und gesperrt, es werden aber auch Zellen in Reserve gehalten.

      Im schlimmsten Fall nimmt mit der Zeit die Gesamt-Speicherkapazität ab 8)

      Das ständige Lesen schadet den Chips nicht.
    • :denk: Das würde ja dann bedeuten, das ich mir da keine Sorgen machen muss solange das Script net alle 2 min in den Speicher schreibt..... :thumbsup:
      Dann werde ich auch alles komplett aufs NAS umstellen, 1. der Zugriff ist schneller und 2. kann ich das Teil in nem andern Raum platzieren, was mit ner eSATA schwierig wird.
    • if your dm500hd is modified to able use usb or your linkstation can have some usb strorage then you can use this solution for silent recording
      Usb or Cf
      dm7080sstt; 2x dm8000sstt; dm7020s <- Diseq1x4 <- 3x Diseq1x10 <-
      Dishes:
      1.8m 36E;28E;23E;19E;16E;13E;7E
      1.6m 42E;36E
      1.0m 10/9E;5E;1W;8W
      1.0m 15W;22W;30W
      1.1m 4/5W;12W;18W;24W
      1.1m 53E;60E
      1.0m 75E
      TVs: Philips 46pfl9707s; Philips 42pfl9703h