L0rdRaiden

Members
  • Posts

    568
  • Joined

  • Last visited

Posts posted by L0rdRaiden

  1. 4 hours ago, Cpt. Chaz said:

     

    This script is built on the native unraid script that includes the zip function. However, it would be easy enough to add an unzip function to my backup script for you to use. I wrote this fairly quickly and only tested once to make sure it worked. Looks like it did, but please use caution until you've tested and are certain. Also, this assumes you only have the one single zip file in $dir. the way it's written, it will unzip every zip file in $dir. Just copy and paste to the end of your script. Hope it helps.

     

    #### SECTION 7 ####------------------------------------------------------------------------------------------------------
    
    echo 'Unzip Flash Backup'
    
    cd "$dir"
    unzip *.zip
    
    #UNCOMMENT THE NEXT LINE IF YOU WISH TO DELETE THE ORIGINAL ZIP FILE AFTER EXTRACTION
    #rm -rfv *.zip

     

    Thanks a lot, I would also need to delete all the content of the folder before the unzip, so the old files won't appear anymore and the unzip or the copy of the file starts always in a clean folder

  2. When I created the libvirt.img I did a big file while probably more than 1 gb will never be needed.

    It's possible to reduce the image file?

    would any of this will work?

     

    qemu-img resize --shrink <image name.img> <size>G

     

    imagen.thumb.png.9ec881165943b6095a30487b82074ac0.png

     

  3. 9 minutes ago, wgstarks said:

    The CA Backups app will do uncompressed backups to the location of your choice IIRC.

    I know the problem with CA backup is that it can not only do flash backup, you have to do it together with appdata (docker) although I guess I could you a dummy folder and

    imagen.png.9351bb8f4194c0d7fbace4c3826ef9d0.png

     

    In any case if I backup the USB will CA remove all the files a backup the current status or will only replace o create files but won't delete older ones?

  4. Does someone has a version of this script that just copy the files without making a zip file?

    The next time the backup is done is ok if it deletes everything in that folder and put the new files.

     

    I'm doing backups with Kopia (highly recommended after trying many) and this would be wonderful to have a decent versioning without taking almost any additional space.

    With Kopia docker I don't have permissions to access to the boot folder so this is the only solution so far

     

    For example for each snapshot

    imagen.thumb.png.4a4b0f363698ba4e1b3b154fc98513ab.png

    You can browse it individually and get any file, restore everything... it has encryption deduplication, compression, and it is way faster than duplicati.

    imagen.thumb.png.72667bd797b15023a9dc5d7eec647129.png

  5. This script does a  backup of the flash drive of unraid, I would like the script to keep only N backups so I can run it every week or day but will only keep N backups and will delete the older ones.

    I have no idea of scripting, can someone help me please?

    I have already modify in my server the route where the zip file is dropped but I don't know how to do the rest.

     

    #!/usr/bin/php -q
    <?PHP
    /* Copyright 2005-2018, Lime Technology
     * Copyright 2012-2018, Bergware International.
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License version 2,
     * as published by the Free Software Foundation.
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     */
    ?>
    <?
    $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
    $var = file_exists('/var/local/emhttp/var.ini') ? parse_ini_file('/var/local/emhttp/var.ini') : [];
    $dir = ['system','appdata','isos','domains'];
    $out = ['prev','previous'];
    
    $server = isset($var['NAME']) ? str_replace(' ','_',strtolower($var['NAME'])) : 'tower';
    $mydate = date('Ymd-Hi');
    $backup = "$server-flash-backup-$mydate.zip";
    
    $used = exec("df /boot|awk 'END{print $3}'") * 1.5;
    $free = exec("df /|awk 'END{print $4}'");
    if ($free > $used) $zip = "/$backup"; else {
      foreach ($dir as $share) {
        if (!is_dir("/mnt/user/$share")) continue;
        $free = exec("df /mnt/user/$share|awk 'END{print $4}'");
        if ($free > $used) {$zip = "/mnt/user/$share/$backup"; break;}
      }
    }
    if ($zip) {
      chdir("/boot");
      foreach (glob("*",GLOB_NOSORT+GLOB_ONLYDIR) as $folder) {
        if (in_array($folder,$out)) continue;
        exec("zip -qr ".escapeshellarg($zip)." ".escapeshellarg($folder));
      }
      foreach (glob("*",GLOB_NOSORT) as $file) {
        if (is_dir($file)) continue;
        exec("zip -q ".escapeshellarg($zip)." ".escapeshellarg($file));
      }
      symlink($zip,"$docroot/$backup");
      echo $backup;
    }
    ?>

     

  6. 10 hours ago, Squid said:

    With the templates, it should be best to leave them at the defaults as the maintainers would have already set the appropriate values accordingly.  IE: set them to be nobody

     

    Unraid doesn't have "users" in the normal Linux way.  

     

    The huge value in docker containers is that they don't have permissions to anything anywhere on your array unless you've explicitly granted them access to it (via the path mappings and whether or not its read-only or read/write).  The PUID / PGID and UMASK basically set the permissions of the files that it writes to the array (if it does) to something that's compatible with Unraid's implementation of user shares.

     

    But for example I mostly use linuxserver.io images

    https://docs.linuxserver.io/images/docker-mariadb

    imagen.png.51c60f3040b7220ed14aa8a8649b05c6.png

     

    I read somewhere that unraid uses "nobody" user for docker so if I do this

     

    imagen.png.c4329c29695d84bd6c0055bfa8c6a07d.png

     

    Should I use that UID and GID as PUID and PGID? or as you said my asumption doesn't make any sense? Please consider that linuxserver.io doesn't specifically create the dockers for unraid.

     

    I am asking this because I get this error in mariadb log

    imagen.png.5e381ec344b60da38252b61262b69b7b.png

  7. I have many dockers with PUID, PGID and UMAS, I have never bothered and I always left the default values, it worker, but....

     

    What is the impact If I use a PUID / PGID that doens't exist in Unraid?

    Should I assign to all my dockers the PUID and PGID of the user nobody in Unraid?

    Is the nobody user in unraid already hardened to use for docker containers?

    If a docker doesn't need special permissions what should be the best way to configure it?

    What should I do with UMASK?

     

    Thanks in advance

  8. Is this normal??


    UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.
    The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.
    UMASK corrected from 022 to 0640 ...

    220118 10:53:37 mysqld_safe Logging to '/config/databases/a33da0ec2e80.err'.
    220118 10:53:37 mysqld_safe Starting mariadbd daemon with databases from /config/databases

     

    Brought to you by linuxserver.io
    -------------------------------------
    
    To support LSIO projects visit:
    https://www.linuxserver.io/donate/
    -------------------------------------
    GID/UID
    -------------------------------------
    
    User uid: 99
    User gid: 100
    -------------------------------------
    
    [cont-init.d] 10-adduser: exited 0.
    [cont-init.d] 30-config: executing...
    [cont-init.d] 30-config: exited 0.
    [cont-init.d] 40-initialise-db: executing...
    [cont-init.d] 40-initialise-db: exited 0.
    [cont-init.d] 90-custom-folders: executing...
    [cont-init.d] 90-custom-folders: exited 0.
    [cont-init.d] 99-custom-files: executing...
    [custom-init] no custom files found exiting...
    [cont-init.d] 99-custom-files: exited 0.
    [cont-init.d] done.
    [services.d] starting services
    [services.d] done.
    UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.
    The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.
    UMASK corrected from 022 to 0640 ...
    220118 10:53:37 mysqld_safe Logging to '/config/databases/a33da0ec2e80.err'.
    220118 10:53:37 mysqld_safe Starting mariadbd daemon with databases from /config/databases

     

  9. 55 minutes ago, ensnare said:

    That worked, I adde the below to my /boot/config/go:

     

    sudo curl -L https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_config -o /tmp/rtl8761bu_config.bin
    sudo mv /tmp/rtl8761bu_config.bin /lib/firmware/rtl_bt/rtl8761bu_config.bin
    sudo curl -L https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_fw -o /tmp/rtl8761bu_fw.bin
    sudo mv /tmp/rtl8761bu_fw.bin /lib/firmware/rtl_bt/rtl8761bu_fw.bin

     

    However, I have to manually unplug and plug-in the usb dongle so the module reloads. Any way to do this programmatically?

     

    Also, where does the device appear? Trying to pass this through to a Home Assistant container, but can't find it!

    I think your script is wrong, why do you rename from rtl8761b_config  to rtl8761bu_config.bin  ?

  10. 45 minutes ago, ensnare said:

    That worked, I adde the below to my /boot/config/go:

     

    sudo curl -L https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_config -o /tmp/rtl8761bu_config.bin
    sudo mv /tmp/rtl8761bu_config.bin /lib/firmware/rtl_bt/rtl8761bu_config.bin
    sudo curl -L https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_fw -o /tmp/rtl8761bu_fw.bin
    sudo mv /tmp/rtl8761bu_fw.bin /lib/firmware/rtl_bt/rtl8761bu_fw.bin

     

    However, I have to manually unplug and plug-in the usb dongle so the module reloads. Any way to do this programmatically?

     

    Also, where does the device appear? Trying to pass this through to a Home Assistant container, but can't find it!

     

    You can run this to see the status of the device "dmesg | grep -i blue"

    You can run this to see the tty and do the passthrough in the container "ls -ltr /dev/tty*|tail -n 1"

    Both in the unraid command line console

     

    Then you create the passthrough in HA container like this.

    imagen.thumb.png.7c152824a2481d046c774b919b103a3d.png

     

     

    I tried to make it work but I couldn't for some reason the integrations in Home Assistant that uses the bluetooth gave me errors.

    If you manage to make it work, please, please, post the solution here. Thanks :)

     

  11. On 9/16/2021 at 9:51 PM, Kuijibo said:

    Did anyone make progress on this? I bought a long-range Bluetooth dongle and can't get it to work. I have the same issue as @L0rdRaiden.

     

    I haven't solve it yet, it would be nice to have some official support for bluetooth devices

     

    @limetech

     

    I guess the solution is here, but even if it works, the driver will disappear after a reboot

    https://linuxreviews.org/Realtek_RTL8761B

     

    There is already a folder for realtek devices, just need to add the new files

    imagen.png.bdd25a72971b6ef85167c5f507f5cd57.png

    https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_config

    https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_fw

    Download and rename to *.bin

  12. On 2/18/2021 at 10:07 PM, L0rdRaiden said:

    I get this error they I try to backup unraid OS USB

     

    2021-02-15 19:12:31 +01 - [Warning-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-FileAccessError]: Error reported while accessing file: /UnraidOS/

     

    How Can I fix it?

     

    imagen.thumb.png.639dea80c31ed70b2c1cc67801055714.pngimagen.png.6dc40306586e8817cd02a4f51acc0ff5.png

     

    Can someone help me with this? how can I backup UnraidOS USB (/boot)?

  13. On 2/18/2021 at 10:07 PM, L0rdRaiden said:

    I get this error they I try to backup unraid OS USB

     

    2021-02-15 19:12:31 +01 - [Warning-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-FileAccessError]: Error reported while accessing file: /UnraidOS/

     

    How Can I fix it?

     

    imagen.thumb.png.639dea80c31ed70b2c1cc67801055714.pngimagen.png.6dc40306586e8817cd02a4f51acc0ff5.png

     

     

    Can someone help me with this please?

  14. On 2/20/2021 at 11:50 PM, saarg said:

    That should be in the unraid log. Not sure what is happening.

    Could you post your docker run command?

    root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='Scrutiny' --net='host' --cpuset-cpus='3,7' --privileged=true -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'TCP_PORT_8080'='8080' -e 'PUID'='1000' -e 'PGID'='1000' -e 'SCRUTINY_API_ENDPOINT'='http://localhost:8080' -e 'SCRUTINY_WEB'='true' -e 'SCRUTINY_COLLECTOR'='true' -v '/mnt/user/Docker/Scrutiny':'/config':'rw' -v '/run/udev':'/run/udev':'ro' -v '/dev':'/dev':'ro' --dns=10.10.50.5 --cap-add=SYS_ADMIN --cap-add=SYS_RAWIO 'linuxserver/scrutiny'

    02278bda8e2da04c238c983c5e85df76703f16eaaacb45dd974f6451b5ba0fe3

  15. Does the new version spam the unraid log with hundreds of line?

     

    Quote

    Feb 20 19:36:00 Unraid crond[273]: user:root entry:*/15 * * * * run-parts /etc/periodic/15min
    Feb 20 19:36:00 Unraid crond[273]: user:root entry:0 * * * * run-parts /etc/periodic/hourly
    Feb 20 19:36:00 Unraid crond[273]: user:root entry:0 2 * * * run-parts /etc/periodic/daily
    Feb 20 19:36:00 Unraid crond[273]: user:root entry:0 3 * * 6 run-parts /etc/periodic/weekly
    Feb 20 19:36:00 Unraid crond[273]: user:root entry:0 5 1 * * run-parts /etc/periodic/monthly
    Feb 20 19:36:00 Unraid crond[273]: user:root entry:0 0 * * * /usr/local/bin/scrutiny-collector-metrics run --api-endpoint http://localhost:8080 >> /config/log/scrutiny-collector-metrics.log 2>&1
    Feb 20 19:36:00 Unraid crond[273]: wakeup dt=56
    Feb 20 19:36:00 Unraid crond[273]: file root:
    Feb 20 19:36:00 Unraid crond[273]: line run-parts /etc/periodic/15min
    Feb 20 19:36:00 Unraid crond[273]: line run-parts /etc/periodic/hourly
    Feb 20 19:36:00 Unraid crond[273]: line run-parts /etc/periodic/daily
    Feb 20 19:36:00 Unraid crond[273]: line run-parts /etc/periodic/weekly
    Feb 20 19:36:00 Unraid crond[273]: line run-parts /etc/periodic/monthly
    Feb 20 19:36:00 Unraid crond[273]: line /usr/local/bin/scrutiny-collector-metrics run --api-endpoint http://localhost:8080 >> /config/log/scrutiny-collector-metrics.log 2>&1

     

  16. Using nerdpack can you give support to devices?

    https://linuxreviews.org/Realtek_RTL8761B

    https://aur.archlinux.org/packages/rtl8761b-fw/

    It is probably the most (if not the only one) bluetooth chip used in usb dongles that supports bluetooth 5.0

     

    Quote

    Jan 22 13:28:51 Unraid kernel: usbcore: registered new interface driver btusb
    Jan 22 13:28:51 Unraid kernel: Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
    Jan 22 13:28:51 Unraid kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
    Jan 22 13:28:51 Unraid kernel: Bluetooth: hci0: RTL: loading rtl_bt/rtl8761b_fw.bin
    Jan 22 13:28:51 Unraid kernel: bluetooth hci0: Direct firmware load for rtl_bt/rtl8761b_fw.bin failed with error -2

    Jan 22 13:28:51 Unraid kernel: Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761b_fw.bin not found