Fireball3

Members
  • Posts

    1355
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Fireball3

  1. You won't have the preclear_finish_xxxxxxxx -file and the preclear_rpt. Only the preclear_start_xxxxxxxxxx is in the log directory. If the first preclear cycles ran without changes in the SMART values, then the drive is probably fine. I would trust it. The only thing is, that the signature for "successful preclear" is probably not set and unRAID won't recognize the drive as precleared. preclear_disk.sh -t /dev/sdX to test if a disk has a current/correct preclear signature. I don't know, if there is an option in the preclear that let's you set the signature? But I think there is a way to skip the read test and shorten the procedure.
  2. Highly possible, that not all options are properly implemented/tested in Dynamix. Even the new (modern) unRAID GUI is not perfect! When doing such vital changes to the array, I would recommend to revert to the stock GUI. Don't know.
  3. Is preclear not removing any partitioning of a disk???
  4. Much interested in the WeeboTech release also! Subscribing...waiting for news...gogogo!
  5. It should be possible to mount a network share (unRAID) on the Synology. They have plenty of apps, maybe you don't even need to work with the console? Make sure you have a GB LAN. Of course you could also use one of your new 3 or 4 TB drives as an intermediate. Make sure you use SATA or eSATA.
  6. If it's that easy and makes such a difference, mabe you show me that example you mentioned.
  7. Thank you, it's already overwhelming what you provided. So after all, there is no other way then forking another process in this case - just for confirmation. I will have to study the last posts and change that accordingly in my script. And then I have to check if everything works. I need to look into the debug function of the shell (set -x -v). Seems useful from what I read. Are you familiar with the DOS shell also? Anyway, I will open another thread for that problem tomorrow.
  8. Then I'm here again - or not?:
  9. OK, now we have a variable set and don't need to call the function. But how do we notice if the hour has passed and we need to check again?
  10. Yes, I thought that too, I have it like | logger -t... What's this <-EOF for? (end of file)?
  11. OK, now we have a variable set and don't need to call the function. But how do we notice if the hour has passed and we need to check again? Edit: wait - I did not scroll down in the code window... Edit2: no, question still valid By the way, I rewrote the logger passage and now it works. The "-" was odd. How can I log multiple lines: log_message " ----------- $program_name version $version --------------------- Configuration settings. Power down instead of sleep: $powerDownInsteadOfSleep Check HDD activity: $checkHDDs Check TCP activity: $checkTCP Check SSH connections: $checkSSH Check TELNET connections: $checkTELNET Check for online clients: $pingIPs Check local logins: $checkSHELL Check for lock file (tmp/nos3sleep.lock): $checkLockFile No sleep/powerdown during hours: $noCountdownHours Save SMART values before powerdown: $save_SMART --- After wake up from sleep: ---- Renew DHCP: $doDhcpRenewal Force GB LAN: $forceGb -----------------------------------------------------------------" I don't have line feed when doing it like this.
  12. OK, so how would our code look like? I will always have to check if hours match. So that call will always be necessary.
  13. I'm sorry but you lost me with this one. Where is the fork and the pipe? Conciseness is OK if you know what you're doing. For example this: if check_hour_list then echo "check_hour_list current hour matched" else echo "check_hour_list current hour DID NOT MATCH" fi Not very clear at first sight (at least to me) because it implies many things I did not know.
  14. Much useful information here Now that you got me on the "return code - trip" I realize that I could save some variable declaration. e.g. check_LockFile () { if [ "$checkLockFile" = $yes ] then if [ -e "/tmp/nos3sleep.lock" ] then LockFile=1 else LockFile=0 fi fi I could simply use the return code. But will this work, if I want to chain the return codes of two functions? Is this recommended? If the variable is needed often it may cause more CPU load to generate the return code every time. Can I mix return code and variables? What would be the right syntax? Like this (to check both return codes)? if [[ hour_match && check_LockFile ]] then Syntax to check one return code and a variable? if [[ check_hour && "$LockFile" -eq 0 ]] then Edit: According to my findings this should be correct: (command expansion for check_hour) if [[ $(check_hour) -eq 0 && "$LockFile" -eq 0 ]] Why are you using the variables like ${P}. I looked-up and found it is used when the variable is mixed with a string. In which line do you expect the misspelling? I can't see any alien character so far. Edit: I've been thinking of this for CountdownHour in ${noCountdownHours} do [ ${hour} = ${CountdownHour} ] && then return 0 done return 1 Won't return 1 overwrite the previous expression? Will the for loop close after the done?
  15. Thanks for taking the time! Well, based on my experience, a Ph.D probably wouldn't be capable of scripting like that. He probably would tell me a story of what's in principle is possible and talk my ear off... This is probably the most essential passage: There is nothing like practice. & You can't teach an old dog new tricks. I think the debug routine which is installed right now is OK. I can adapt your variables but the different logging options are welcome. This is not done in your version. There is only one problem when I call it like this: log_message () { logger –t$program_name "$1" It will log like this: Mar 5 21:16:43 tower logger: \226tauto_s3_sleep.sh Start checking conditions for standby... Mar 5 21:16:43 tower logger: \226tauto_s3_sleep.sh Not sleeping due to time of day. This will most likely be the same with your code, don't you think? Where is the "\226t" coming from? And why can't I pass the code in lines 109 to 124 with this command? Additionally, can you elaborate on why the next line in the go file is not working? /boot/auto_s3_sleep.sh | at now +45 minutes There is no delay. The script is starting right away.
  16. OK Sir! Thank you for the pointer. First of all, let me illustrate how I see our (your's and mine) skill levels in these things: You = Ph.D vs. me = primary school You = concerned about runtime, load, efficiency vs. me = happy when it runs From my questions in the former posts you probably noticed this already... Also I'm "just" building on top of something that existed - without knowing if it's good or not. At this point I'm just happy it runs somehow... Now, I would like to implement your advice but to be honest, I probably understand 50% of that code. Either you help me in understanding your script-fu by commenting more in detail or you hack it in that script on your own (which probably takes less of your time). Find attached my working edition. ...now I'm p****** off to further study your code snippets... Edit: I'm back with some questions...see comments within the code. #!/bin/bash [ ${DEBUG:=0} -gt 0 ] && set -x -v #this does exactly what (set -x -v)? #next lines look like chinese to me but I will take them as given... B=${0##*/} # basename of program D=${0%%/$B} # dirname of program E=${B#*.} # Extension P=${B%.*} # strip off after last . character # echo "D=${D} B=${B} P=${P} E=${E}";exit # when do you use this? Clear so far, but the expression log_message "..." $.. is easier to write and looks more comprehensible (at least to my noob brain). Is there a way to enhance the log_message function to do the equivalent of your line of code? e.g. log_message () { logger -t${P}[${BASHPID}] "$1" Another shitload of noob questions - sorry: #!/bin/bash check_hour() { # this is a waste of CPU resources echo $(date +%H) } check_minute() { # this is a waste of CPU resources echo $(date +%m) } funca() { # what is the use of this function echo $BASHPID #returns PID in order to do what??? } hour=`check_hour` noCountdownHours="18 19 20 21 22 23" echo $BASHPID #what's the good of those 2 lines? funca check_hour_list() #this function can replace the hourMatch expression in the current script { HOUR=$(date +%H) for CountdownHour in ${noCountdownHours} do if [ ${HOUR} = ${CountdownHour} ] then return 0 fi done return 1 } hour=$(date +%H) # this is a waste of CPU resources hourMatch=$(echo "$noCountdownHours" | grep "$hour" | wc -l) echo $hourMatch check_hour_list if [ $? -eq 0 ] #$? refers to what variable? the return value from check_hour_list? then echo "check_hour_list current hour matched" else echo "check_hour_list current hour DID NOT MATCH" fi if check_hour_list # the necessity of this if construction is not clear to me then echo "check_hour_list current hour matched" else echo "check_hour_list current hour DID NOT MATCH" fi auto_s3_sleep.sh_working_but_ugly_logging.txt
  17. You mentioned, that you had problems with smart errors before you started "works" on the controller! Nevertheless, should be clear to everyone.
  18. That was the only problem. The script runs fine now but some changes don't work like intended. This expression doesn't seem to work: log_message () { if [ "$debug" -eq 2 ] then logger –t$program_name "$1" #logger "$1" fi the log entry is like this: Mar 5 21:16:43 tower logger: \226tauto_s3_sleep.sh Start checking conditions for standby... Mar 5 21:16:43 tower logger: \226tauto_s3_sleep.sh Not sleeping due to time of day. when called: log_message "Start checking conditions for standby..." Whereas this one does: .... | logger -t$program_name logs like this: Mar 5 21:16:43 tower auto_s3_sleep.sh: Renew DHCP: no Mar 5 21:16:43 tower auto_s3_sleep.sh: Force GB LAN: yes Mar 5 21:16:43 tower auto_s3_sleep.sh: ----- I'm probably calling the internal function log_message in a wrong way? Next thing is, I'm calling the script in the go file like this: /boot/auto_s3_sleep.sh | at now +45 minutes It is not starting with 45 minutes delay though...
  19. Just read this in the changelog for v6 beta4 This may be a bug in v5 also. Although we don't know what version you're running... If you're on v5 then please report this to limetech to get it fixed in the next update!
  20. After reading the detailed explanation of what you did (unfortunately the external pics are blocked here) it doesn't seem like a simple user fault to me. PSU is delivering the right voltage - tested after the incident. (presupposing the wiring remained the same...) There may be an issue with the backplane. Perhaps a short-circuit somewhere? In the sata plugs? On the PCB? On the power side of a drive? If possible, use a multimeter and check the backplane. Or get a tester as linked above and check the backplane.
  21. Sorry, but I can't help you with the hanging GUI. If you can reproduce that easily, then it's best you open a ticket. Or wait, until somebody more knowledgeable chimes in.
  22. If you can reproduce the "hanging" of the GUI, you should open a ticket with limetech. But only if you're on stock unraid - no plugins. The smb shares config is stored on the usb stick. Can't check the exact location at the moment though. Probably it's stored in the config folder. You might change the values there (use a nix compatible editor!). Then you probably need to restart the samba server.
  23. That's bad luck for you . Although I can't exactly follow how you wired your drives, there may be hope after all. Perhaps you can elaborate what electric tension you put on the drives pins. If you fried only the PCB's (that's highly probable) you might be able to swap them and get the drives up again - at least to get the data off. Check the PCB for burns. Search the net for instructions how to swap the PCB on your type of hard disk. You can also search this forum. There was an user who also killed his PCB.
  24. Also here. A non-exhaustive list. Pick one that is suitable for your mainboard/slots and available in your region.