Everything posted by JoeUnraidUser
-
Unraid OS version 6.11.5 available
I have also noticed that throughout the v6.11.x releases that Samba has gotten slower. Before I used to get a steady 100 MB/s. Now I get a roller coaster between 70 MB/s and 20 MB/s. Also, when I transfer over 5 GB in files, it will stall multiple times to 0 MB/s.
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
I'm not sure what you are trying to do. "./backupDockers.sh -l" only lists the dockers you have installed on the system, not the backups of the dockers. You should never use /mnt/cache as your backup directory. The backup will fail because it syncs the files to a folder called appdata in the backup directory. appdata is usually located in /mnt/cache/appdata. It would mean it is trying to overwrite itself.
-
Not disclosed in the release notes
I updated from 6.11.0-rc3 to 6.11.0-rc5. I use a number of PERL modules. After the install of 6.11.0-rc5 I tried updating the PERL modules and it was getting the following error: fatal error: sys/types.h: No such file or directory I finally chased down the problem to glibc. I know that it was working before. While on 6.11.0-rc2 I had reloaded all the PERL modules from scratch and did not get this error. The reason I had reloaded all the PERL modules from scratch was part of the process of figuring out which packages I needed to put in /boot/extra that were being provided by NerdPack and DevPack. glibc was not one of the needed packages. Since you told me where to find the installed packages, I removed glibc-2.36-x86_64-3.txz from /boot/extra and rebooted to see if glibc is there. I see that glibc-2.36-x86_64-3_LT is installed. I went ahead and reloaded my PERL modules from scratch and I get the same error: fatal error: sys/types.h: No such file or directory So, I guess glibc-2.36-x86_64-3_LT is not loading sys/types.h correctly. I put glibc-2.36-x86_64-3.txz back into /boot/extra, rebooted, and now everything is working fine again. I have been running the following script from the go file for years with no problems. One of the things it does is appends to .bash_profile. After logging into Unraid using SSH I tried to run an alias I set in .bash_profile called bin and it said command not found. I typed alias and saw it wasn't set. I checked .bash_profile and it had been overwritten. I finally figured out that sometime during the boot process .bash_profile is now being overwritten. #!/bin/bash if [ -f /root/.bash_profile.orig ] then cp /root/.bash_profile.orig /root/.bash_profile else cp /root/.bash_profile /root/.bash_profile.orig fi ( cat <<"EOF" # alias alias bin="/usr/bin/ls -al /root/bin" # Perl PERLHOME="/root/perl5"; export PERLHOME; PERL5LIB="$PERLHOME/lib/perl5"; export PERL5LIB; PERL_MB_OPT="--install_base $PERLHOME"; export PERL_MB_OPT; PERL_MM_OPT="INSTALL_BASE=$PERLHOME"; export PERL_MM_OPT; PERL_LOCAL_LIB_ROOT="$PERLHOME"; export PERL_LOCAL_LIB_ROOT; # Path PATH=.:/root/bin:$PERLHOME/bin:$PATH EOF ) >> /root/.bash_profile ln -s /boot/config/perl5 /root/perl5 rsync -hrltgoD --delete --chown=root:root --chmod=ugo=rwx "/boot/config/bin/" /root/bin modprobe i915 chmod -R 777 /dev/dri I fixed it by adding a sleep 10 to the beginning of the script. It would have been nice to know this change in the release notes.
-
Not disclosed in the release notes
Packages were removed such as glibc without any notice in the release notes. Only what has been updated is listed. If a package has been removed, it should also be listed. There should be a place that defines all the packages that are included in the distribution. This is important information to have since NerdPack and DevPack are no longer supported and the user now has to maintain their own additional slackware packages. There was a new change in writing to .bash_profile while booting however it was not mentioned in the release notes and those of us that append to .bash_profile from the go file get overwritten by the change. @limetech
-
how to find duplicate files
See this post:
-
Unraid OS version 6.10.3 available
I had permission issues with my dockers after the upgrade and fixed the problems by running the following: chown -cR nobody:users /mnt/user/appdata/* chmod -cR ug+rw,ug+X,o-rwx /mnt/user/appdata/*
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
I just tried downloading the file from the link and the download still works.
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
You can run it from any folder except the flash drive. You can then run it from within a script in the UserScripts plugin.
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
That's exactly why I used a cache.
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
I can't seem to make it get the same error. What command line are you entering?
-
How to install 7z?
Sorry for my confusion. To install p7zip: Install the NerdPack plugin. Go to SETTINGS and click on Nerd Pack. Turn on p7zip-16.02-x86_64-1sl.txz. Then click on APPLY at the bottom. You may have to reboot for it to take effect if the apply doesn't work.
-
How to install 7z?
Try typing in the full path: /usr/bin/7z
-
How to install 7z?
7z is already installed in /usr/bin/7z. In a terminal type 7z and hit enter.
-
[Plugin] CA User Scripts
To set the umask to 0000 do the following on a line before your command: umask 0
-
[Plugin] CA User Scripts
Try adding the following to the beginning of your command so it runs in a login shell: sudo -i -u root
-
[Plugin] CA User Scripts
I had the same problem when running PERL scripts. I had to hardcode library and config paths. Try running the script in a login shell by doing the following: su - root /mnt/user/test/test.sh <<<password --or-- sudo -i -u root /mnt/user/test/test.sh
-
[Plugin] CA User Scripts
You could use the following: echo $(eval echo "~$(whoami)")
-
[Plugin] CA User Scripts
You can achieve the same thing from the command line with PERL: perl -pi -e 's/#FF8C2F/#42ADFA/g' /mnt/user/text/mytestfile.txt Perl one-liners
-
[Plugin] CA User Scripts
Your right it doesn't work. I tested it using "MON" and it failed. It looks like Unraid is using "crond 4.5 dillon's cron daemon". It's strange because the man page crontab(1) for "dillon's lightweight cron daemon" contains: a symbolic range for the day of week and month in year # run at 11 am on the first and last Mon, Tue, Wed of each month 0 11 1,5 * mon-wed date Edit: I tested it again using "mon" and it worked. It must only work with lowercase days of the week.
-
[Plugin] CA User Scripts
"or use names" means SUN-SAT or sun-sat. Example crontab line from man page crontab(5): 5 4 * * sun echo "run at 5 after 4 every sunday" Edit: Also from man page crontab(5): Names can also be used for the 'month' and 'day of week' fields. Use the first three letters of the particular day or month (case does not matter). Ranges or lists of names are not allowed.
-
[Plugin] CA User Scripts
The last field should be day of week. Allowed values are 0-6, 7 for Sunday or SUN-SAT. 0 6 * * MON is 06:00 on Monday From the crontab man page crontab(5) : field allowed values ----- -------------- minute 0-59 hour 0-23 day of month 1-31 month 1-12 (or names, see below) day of week 0-7 (0 or 7 is Sunday, or use names)
-
[Plugin] CA User Scripts
To run mover enter the following command: /usr/local/sbin/mover
-
Additional Scripts For User.Scripts Plugin
Script to convert text files from DOS to Unix format. dos2unix #!/bin/bash # Convert text files from DOS to Unix format. if [ $# -eq 0 ] || [ "$1" == "--help" ] then printf "Usage: dos2unix <files>...\n" exit 0 fi for file in "${@}" do user=$(stat -c '%U' "$file") group=$(stat -c '%G' "$file") perms=$(stat -c "%a" "$file") tmp="$file.$(date +%N)" cat "$file" | fromdos > "$tmp" mv "$tmp" "$file" chown $user:$group "$file" chmod $perms "$file" done Script to convert text files from Unix to DOS format. unix2dos #!/bin/bash # Convert text files from Unix to DOS format. if [ $# -eq 0 ] || [ "$1" == "--help" ] then printf "Usage: unix2dos <files>...\n" exit 0 fi for file in "${@}" do user=$(stat -c '%U' "$file") group=$(stat -c '%G' "$file") perms=$(stat -c "%a" "$file") tmp="$file.$(date +%N)" cat "$file" | todos > "$tmp" mv "$tmp" "$file" chown $user:$group "$file" chmod $perms "$file" done
-
UNRAID 6.7.1 easy way to backup and restore specific dockers
Backup/Restore dockers. The backup directory contains cache files and Gzip files. Running dockers are stopped and started during backup and restore. Gzip compression is used so the owner and permissions are preserved in the backup files. If you want to run with hard coded variables, then set the variables under Defaults. Usage: Usage: backupDockers.sh: [-a] [-d <backup directory>] [<dockers and/or archive files>...] -b : backup mode -r : restore mode -l : list dockers -a : all dockers -c : crc comparison during rsync, default is check time and size -d : set backup directory -s : save backup during restore Examples: Backup dockers into a specific backup directory: backupDockers.sh -b -d /mnt/user/backup/dockers binhex-plexpass transmission Restore docker latest file and a certain docker file from a specific backup directory: backupDockers.sh -r -d /mnt/user/backup/dockers binhex-plexpass transmission.2019-07-02-12-30-38-EDT.tgz Backup all dockers into a specific backup directory: backupDockers.sh -bad /mnt/user/backup/dockers Restore all dockers from a specific backup directory: backupDockers.sh -rad /mnt/user/backup/dockers Source: If copy/paste doesn't work then download the file. backupDockers.sh #!/bin/bash # Defaults backup="/mnt/user/Backup/Dockers" restore=false all=false checksum=false dockers=() files=() usage() { echo "Usage: backupDockers.sh: [-a] [-d <backup directory>] [<dockers and/or archive files>...]" echo echo " -b : backup mode" echo " -r : restore mode" echo " -l : list dockers" echo " -a : all dockers" echo " -c : crc comparison during rsync, default is check time and size" echo " -d : set backup directory" echo " -s : save backup during restore" echo exit 1 } while getopts 'brlacd:?h' opt do case $opt in b) restore=false ;; r) restore=true ;; l) docker ps -a --format "{{.Names}}" | sort -fV exit 0 ;; a) all=true ;; c) checksum=true ;; d) backup=${OPTARG%/} ;; h|?|*) usage ;; esac done shift $(($OPTIND - 1)) if [ "$all" == "true" ] then readarray -t all < <(printf '%s\n' "$(docker ps -a --format "{{.Names}}" | sort -fV)") else all=() fi readarray -t items < <(printf '%s\n' "$@" "${dockers[@]}" "${all[@]}" | awk '!x[$0]++') [ "${items[0]}" == "" ] && usage for item in "${items[@]}" do if echo $item | grep -sqP ".+\.\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d-\w+\.tgz" then files+=("$item") else if [ ! -z $item ] then dockers+=("$item") fi fi done date=$(date +"%Y-%m-%d-%H-%M-%S-%Z") echo "DATE: $date" appdata="/mnt/user/appdata" cache="$backup/appdata" if [ "$restore" == "true" ] then restores=() errors=() for docker in "${dockers[@]}" do file="$(ls -t $backup/$docker/*.tgz 2>/dev/null | head -1)" [ -e "$file" ] && restores+=("$file") || errors+=("$docker") done for file in "${files[@]}" do docker=$(echo $file | cut -d '.' -f 1) file="$backup/$docker/$file" [ -e "$file" ] && restores+=("$file") || errors+=("$file") done for error in "${errors[@]}" do archive=$(echo "$error" | rev | cut -d '/' -f 1 | rev) echo "ERROR: $archive: archive not found" done readarray -t restores < <(printf '%s\n' "${restores[@]}" | awk '!x[$0]++') for restore in "${restores[@]}" do archive=$(echo "$restore" | rev | cut -d '/' -f 1 | rev) docker=$(echo "$archive" | cut -d '.' -f 1) [ "$docker" == "" ] && continue echo "DOCKER: $docker" running=$(docker ps --format "{{.Names}}" -f name="^$docker$") if [ "$docker" == "$running" ] then echo "STOP: $docker" docker stop --time=30 "$docker" >/dev/null fi cd "$appdata" backup="$docker.$date" echo "MOVE: $docker -> $backup" mv -f "$docker" "$backup" 2> /dev/null if [ -d "$backup" ] then echo "RESTORE: $archive -> $appdata" #tar --same-owner --same-permissions -xzf "$restore" pv $restore | tar --same-owner --same-permissions -xzf - if [ ! -d "$appdata/$docker" ] then echo "ERROR: restore failed" mv -f "$backup" "$docker" 2> /dev/null if [ ! -d "$appdata/$docker" ] then echo "ERROR: repair failed" fi fi if [ ! -d $docker ] then echo "ERROR: restore failed" fi else echo "ERROR: move failed" fi if [ "$docker" == "$running" ] then echo "START: $docker" docker start "$docker" >/dev/null fi done else for docker in "${files[@]}" "${dockers[@]}" do if ! docker ps -a --format "{{.Names}}" | grep $docker -qs then echo "ERROR: $docker: docker not found" fi done mkdir -p "$backup" "$cache" chown nobody:users "$backup" "$cache" chmod ug+rw,ug+X,o-rwx "$backup" "$cache" for docker in "${dockers[@]}" do if [ -d "$appdata/$docker" ] then echo "DOCKER: $docker" running=$(docker ps --format "{{.Names}}" -f name="^$docker$") if [ "$docker" == "$running" ] then echo "STOP: $docker" docker stop --time=30 "$docker" >/dev/null fi echo "SYNC: $docker" [ "$checksum" == "true" ] && checksum=c || checksum= rsync -ha$checksum --delete "$appdata/$docker" "$cache" if [ "$docker" == "$running" ] then echo "START: $docker" docker start "$docker" >/dev/null fi mkdir -p "$backup/$docker" echo "GZIP: $docker.$date.tgz" tar cf - -C "$cache" "$docker" -P | pv -s $(du -sb "$cache/$docker" | cut -f 1) | gzip > "$backup/$docker/$docker.$date.tgz" chown -R nobody:users "$backup/$docker" chmod -R ug+rw,ug+X,o-rwx "$backup/$docker" fi done fi date=$(date +"%Y-%m-%d-%H-%M-%S-%Z") echo "DATE: $date"
-
[Plugin] CA User Scripts
This script will stop the running dockers, sleep for a specified duration, and start the previously running dockers. If you want to run your backup from this script, just replace "echo Pausing $pause..." and "sleep $pause" with your own code. #!/bin/bash pause=1m running=$(docker ps --format "{{.Names}}" | sort -fV) echo Stopping Dockers... for docker in $running { docker stop --time=30 $docker } echo Pausing $pause... sleep $pause echo Starting Dockers... for docker in $running { docker start $docker } pauseDockers.sh Edit: Copy/Paste is a pain.