Jump to content

bonienl

Community Developer
  • Posts

    10,233
  • Joined

  • Last visited

  • Days Won

    65

Everything posted by bonienl

  1. Weebotech, thanks for your input here, much appreciated, certainly more food for thought Though I use "date" and "state" quite regular I always find myself looking at the help information to see which abbreviation is used for what particular item, in other words although their capabilities are very versatile there aren't very intuitive. If an export format option is added I would prefer to use abbreviations which make sense, like your proposed "%H|%F|%D" (one can even argue to make these case insensitive). Exporting of internal variables I find a risky business, using eval you would allow potentially every variable to be exported ... not my choice.
  2. Go to the main page and click on one of disk names. This brings you to the sub-level, here you find the Health tab.
  3. I started with your tool and had all my files scanned/hashed. Didn't want to go through the whole timely process again by just changing a tool. Compatibility is indeed a nice addition when people use one or the other or perhaps both ... Maybe you want to consider your file output as "<hash value>|<full path/filename>|<scandate>" it will also make files interchangeable. I studied your approach of recovery in bitrot, but I am not confident enough myself to build that into my script, this is hard to test for me
  4. Introduction bunker is a file integrity check utility based on the original bitrot utility of jbartlett and the calculated sha keys are compatible with bitrot. I want to thank jbartlett for bringing out his excellent idea and my version can be seen as an alternative which I initially developed to fulfill my own requirements and now may be useful to others. The purpose of bunker is to save the calculated hash value in the extended attributes of a given file, this allows for regular checking of the integrity of the file content. Note that the original file is never touched or altered by bunker no matter what options are chosen. Different hashing methods are stored under different extended attributes, it is possible to store sha256, md5 and blake2 hashes together with a file, if that is desired. Versions Version 1.16 verify location of 'notify' script to support unRAID v6.x Version 1.15 Fixed execution of export (-e) command Fixed -D option (modified time calculation) Swapped -r and -R commands Added new extended attribute: file size Added display of file name being processed Code optimizations Version 1.14 logger corrections and code optimization (thx itimpi) Version 1.13 logger improvements (thx itimpi) Version 1.12 added new option -L which allows to log only changes Version 1.11 bug fix, correction in report calculation (thx archedraft) Version 1.10 more comprehensive reporting, and minor bug fix Version 1.9 (minor) bug fixing release Version 1.8 introduced new option -n (notify) which let bunker send alert notifications when file corruption is detected Version 1.7 introduced new filedate attribute. New -t (touch) command. Various improvements. Version 1.6 regression fix in -v command and add missing files display for -c command Version 1.5 introduced new command -U and new option -D Version 1.4 is a bug fixing release. Correct ETA calculation, fix scandate with -C option, sort output files. Version 1.3 has new options -c and -C which allows the checking of the hash values from a previous exported file. This can be used for example when transferring files from one filesystem to another, e.g. from reiserfs to xfs, during this process extended attributes are not copied over, but with the -c (-C) option these can be verified/restored afterwards, make sure to do an export of the hash keys before the file transfer. Version 1.2 uses the already installed utilities sha256sum and md5sum, no external package needs to be installed unless one wants to make use of the new option '-b2'. This uses the blake2 algorithm. A download of the blake2 utility can be obtained from the Blake2 site. Extract the file "b2sum-amd64-linux" rename it "b2sum" and copy it to your server, e.g. to /usr/bin/b2sum. Version 1.1 is the initial release. Usage The following is from the help of bunker. bunker v1.16 - Copyright (c) 2015 Bergware International Usage: bunker -a|A|v|V|u|U|e|t|i|c|C|r|R [-fdDsSlLnq] [-md5|-b2] path [!] [mask] -a add hash key attribute for files, specified in path and optional mask -A same as -a option with implicit export function (may use -f) -v verify hash key attribute and report mismatches (may use -f) -V same as -v option with updating of scandate of files (may use -f) -u update mismatched hash keys with correct hash key attribute (may use -f) -U same as -u option, but only update files which are newer than last scandate -e export hash key attributes to the export file (may use -f) -t touch file, i.e. copy file modified time to extended attribute -i import hash key attributes from file and restore them (must use -f) -c check hash key attributes from input file (must use -f) -C same as -c option and add hash key attribute for files (must use -f) -r remove hash key attribute from specified selection (may use -f) -R same as -r option and remove filedate, filesize, scandate values too (may use -f) -f <file> optional set file reference to <file>. Defaults to /tmp/bunker.store.log -d <days> optional only verify/update/remove files which were scanned <days> or longer ago -D <time> optional only add/verify/update/export/remove files newer than <time>, time = NNs,m,h,d,w -s <size> optional only include files smaller than <size> -S <size> optional only include files greater than <size> -l optional create log entry in the syslog file -L optional, same as -l but only create log entry when changes are present -n optional send notifications when file corruption is detected -q optional quiet mode, suppress all output. Use for background processing -md5 optional use md5 hashing algorithm instead of sha256 -b2 optional use blake2 hashing algorithm instead of sha256 path path to starting directory, mandatory with some exceptions (see examples) mask optional filter for file selection. Default is all files when path or mask names have spaces, then place names between quotes precede mask with ! to change its operation from include to exclude Examples: bunker -a /mnt/user/tv add SHA key for files in share tv bunker -a -S 10M /mnt/user/tv add SHA key for files greater than 10 MB in share tv bunker -a /mnt/user/tv *.mov add SHA key for .mov files only in share tv bunker -a /mnt/user/tv ! *.mov add SHA key for all files in share tv except .mov files bunker -A -f /tmp/keys.txt /mnt/user/tv add SHA key for files in share tv and export to file keys.txt bunker -v -n /mnt/user/files verify SHA key for previously scanned files and send notifications bunker -V /mnt/user/files verify SHA key for scanned files and update their scandate bunker -v -d 90 /mnt/user/movies verify SHA key for files scanned 90 days or longer ago bunker -v -f /tmp/errors.txt /mnt/user/movies verify SHA key and save mismatches in file errors.txt bunker -u /mnt/disk1 update SHA key for mismatching files bunker -U /mnt/disk1 update SHA key only for mismatching files newer than last scandate bunker -u -D 12h /mnt/disk1 update SHA key for mismatching files created in the last 12 hours bunker -u -f /tmp/errors.txt update SHA key for files listed in user defined file - no path bunker -e -f /tmp/disk1_keys.txt /mnt/disk1 export SHA key to file disk1_keys.txt bunker -i -f /tmp/disk1_keys.txt import and restore SHA key from user defined file - no path bunker -c -f /tmp/disk1_keys.txt check SHA key from user defined input file - no path bunker -C -f /tmp/disk1_keys.txt check SHA key and add SHA attribute (omit mismatches) - no path bunker -r /mnt/user/tv remove SHA key for files in share tv bunker -r -f /tmp/errors.txt remove SHA key for files listed in file errors.txt - no path Look at the examples to make use of the possibilities of bunker. Operation There are two main ways to use the utility: [1] interactive or [2] scheduled. Interactive When used in interactive mode the utility can be executed from a telnet session with the given options, and results are made visible on screen. Stopping the utility can be done at any time using 'CTRL-C'. It is also possible to open several telnet sessions and run multiple bunker instances concurrently, e.g. for checking different disks. Most of the time is spent on I/O access and calculating/checking a large disk can be a lengthy process, for example it takes almost 7.5 hours on my system to go through a nearly full 2TB disk. Scheduled Another way of operation is to create scheduled tasks to do regular file verifications and/or other activities. For example I created the script 'bunker-daily' and copied this file to the folder /etc/cron.daily. It checks for new files, file changes and updates the export file. It will go thru all available disks (thx itimpi). #!/bin/bash bunker=/boot/custom/bin/bunker log=/boot/custom/hash/blake2 var=/proc/mdcmd day=$(date +%Y%m%d) array=$(grep -Po '^mdState=\K\S+' $var) rsync=$(grep -Po '^mdResync=\K\S+' $var) mkdir -p $log # Daily check on new files, report errors and create export file if [[ $array == STARTED && $rsync -eq 0 ]]; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do if [[ -e /mnt/disk$i ]]; then $bunker -A -D 1 -q -l -f $log/disk$i.$day.new.txt /mnt/disk$i $bunker -U -D 1 -q -l -n -f $log/disk$i.$day.bad.txt /mnt/disk$i if [[ -s $log/disk$i.export.txt ]]; then if [[ -s $log/disk$i.$day.new.txt || -s $log/disk$i.$day.bad.txt ]]; then mv $log/disk$i.export.txt $log/disk$i.$day.txt $bunker -e -q -l -f $log/disk$i.export.txt /mnt/disk$i fi else $bunker -e -q -l -f $log/disk$i.export.txt /mnt/disk$i fi fi done fi This can be combined with a verification script which checks for file corruptions. I do this on monthly bases, but it may be done on weekly basis instead. Copy the file bunker-monthly to /etc/cron.monthly. Note that you need to adjust the script to the number of disks in your system. #!/bin/bash bunker=/boot/custom/bin/bunker log=/boot/custom/hash/blake2 var=/proc/mdcmd day=$(date +%Y%m%d) array=$(grep -Po '^mdState=\K\S+' $var) rsync=$(grep -Po '^mdResync=\K\S+' $var) mkdir -p $log # Monthly verification of different group of disks (quarterly rotation) if [[ $array == STARTED && $rsync -eq 0 ]]; then case $(($(date +%m)%4)) in 0) for i in 1 2 ; do $bunker -v -n -q -l -f $log/disk$i.$day.bad.txt /mnt/disk$i & done ;; 1) for i in 3 4 5 ; do $bunker -v -n -q -l -f $log/disk$i.$day.bad.txt /mnt/disk$i & done ;; 2) for i in 6 7 8 ; do $bunker -v -n -q -l -f $log/disk$i.$day.bad.txt /mnt/disk$i & done ;; 3) for i in 9 10 ; do $bunker -v -n -q -l -f $log/disk$i.$day.bad.txt /mnt/disk$i & done ;; esac fi Export / Import The purpose of export and import is to create and save a copy of the hash keys of the given files (export) which can be restored at later time (import), e.g. after a disk crash keys can be imported to run a file verification afterwards to see if content has been damaged. Export/import is not a file repair method but a mechanism to find corruptions. Other tools need to be used to do any file repair. Download See the attachment to download the zip file. Copy the file 'bunker' to your flash or other convenient location, and execute it from there. Optionally use the files bunker-daily and bunker-monthly. Extra Included in the zip file are two additional scripts bunker-update and bunker-verify, provided by courtesy of itimpi. You can place these scripts in the cron.hourly and cron.daily folders respectively and introduce automation of the file checking. bunker.zip
  5. It works fine for me. More information on how it breaks would be useful then I'm sure someone will have an answer. Kevin. You're right of course. From how the breakage looks here I presumed it'd be universally reproduced. What happens here is that the sheer installation of the S3 Sleep plugin over the updated dynamix messes up all the pages of the webGUI. It appears as if there's no CSS and no PHP actions (HTML text, no formatting, no action on buttons). Sample screenshot attached. When S3 Sleep is installed on the "vanilla" (beta12) Dynamix, no problem. When Dynamix is updated - breakage. When I remove S3 Sleep, then update Dynamix to latest - no problem; when I now install S3 Sleep - breakage. Deleting the S3 plugin files and rebooting doesn't fix the breakage. Deleting the entire /boot/config/plugins/dynamix - does. Deleting only /boot/config/plugins/dynamix/dynamix.cfg - also does. The problem seems to be with the fact that S3 Sleep plugin writes the dynamix.cfg file if it does not exist. What I end up with here is: [confirm]\nsleep="1"\n [display]\nsleep="plugins/dynamix.s3.sleep/Sleep.php"\n That's the entire file. I'm guessing you don't experience this because you do have dynamix.cfg already, in which case the plugin edits it, and seems to do that correctly. Thanks for the detailed explanation. I see if I can reproduce this error and make a fix accordingly. For the time being use the workaround as described by digitalfixer.
  6. Mods - this topic is out of place under v5, can it be moved to the V6 section ? Thx.
  7. I understand but you should try the modification provided, for me it works very well!!! bwm-ng -u bits -o csv -c 30 -d 0 -t 1000 -T avg | grep eth0 | cut -d";" -f5 | tail -1 | sed 's/.\{6\}$//' Sorry I overlooked your modification, I have a look.
  8. Yeah, this is a known issue. It requires changes in emhttp to have interactivity, it is on the todo list.
  9. For the moment S3 sleep was converted to v6 design just to make it work. Right now I am quite busy with the whole integration thing in v6, but once time permits I have a look at improving S3 sleep.
  10. It depends a bit on the structure you want to build, in your case a 'master' file is created under "Othersettings" or another parent. The header section for this file looks file: Menu="OtherSettings" Type="xmenu" Title="APC UPS" Icon="apcupsd.png" Tabs="true" --- The next file (tab) within the APC section then has a header section as follows (assuming the master file is called "APCUPS.page"): Menu="APCUPS" Title="More Settings" ---
  11. You need to break the single file into multiple files, each file will represent a different tab. You can force the display of tabs or not, by setting Tabs="true" or Tabs="false" in the file header, when this entry is not present the page will be viewed depending on the setting of "page view".
  12. Good to hear, I have made a correction to the installation script as well, this will become available in an upcoming version.
  13. This is indeed happening. I will look into an approach that suites the requirements. For the time being use the workaround as explained above.
  14. Powerdown is available as a separate plugin and can be installed using this URL: https://github.com/dlandon/unraid-snap/raw/master/powerdown-x86_64.plg
  15. That seems to have worked, thanks! Both temps show 117; not sure if that's right. I'd expect them to be at least a little different. ** I refreshed a few times, and now they are different. Any way to know which is which? There are no labels. Hover your mouse over the temperature icons and labels are shown: left is processor, right is motherboard.
  16. Notifications in the new system are event driven, this is a different approach from the past in which the email script in the background would poll every so many minutes to check status and report. In this situation email notifications and browser notifications was strictly separated. The event approach allows the usage of event handlers which determine what and how to process a notification, e.g. send a mail, show a popup or do both, this however is still work in progress and event handlers are being added for upcoming updates.
  17. Okay, I see what went wrong. Need to make a modification to the installation file (.plg). You better delete the file, it is completely mixed-up (don't worry settings will return to default once you delete).
  18. No, I wasn't referring to any plugin specifically, it is meant as general knowledge. I am not using apcupsd myself, but if file locations in the .tgz file are as per v6 design, it should be all fine.
  19. I tried this. Nothing about sleep appears under Display settings. Kevin. Before uninstall/install did you save display settings ?
  20. Can you try the following: 1. Goto Settings -> Display Settings and press Apply (this saves settings to the flash memory) 2. Uninstall and re-install S3.sleep plugin, after installation, it should add a "sleep" key to the file created in step 1 3. Sleep button should now be visible
  21. This is a known issue, periodic status updates (screen updates) is on radar, it requires changes in emhttp.
  22. Does the file /boot/config/plugins/dynamix/dynamix.cfg exist ? And what is the content of that file ? (sorry mixed up questions)
  23. ah, sorry for the confusion. If you are using a sensors.conf file, you need to move it into the folder /boot/config. Otherwise you need to create one to set the correct names for the sensors of your M/B and CPU.
  24. Can you uninstall and re-install S3.sleep. It should add the key sleep="plugins/dynamix.s3.sleep/Sleep.php" under display settings, once this key exists the sleep button becomes visible.
×
×
  • Create New...