JoeUnraidUser

Members
  • Posts

    208
  • Joined

Everything posted by JoeUnraidUser

  1. Here is a script you can use. Just replace source and target with your folder paths. #!/bin/bash limit=4G source="/mnt/user/source" target="/mnt/user/target" limit=$(echo $limit | cut -d 'G' -f 1) for dir in "$source"/*/ do size=$(du -sBG "$dir" | cut -d 'G' -f 1) if (( $size > $limit )) then echo $size\G $dir \-\> $target mv "$dir" "$target" fi done moveDirBySize.sh
  2. I have been running my script from a cron job every night for several years. I didn't know that at some point a "newperms" script was made. edit: I looked at the "newperms" script and noticed some things I don't like. It sets other and group to the same permissions as user. If user is not set properly, then group and other do not get set properly. Mine clears other which makes it docker safe and for security reasons not world readable, writable, or executable. edit: I did a chmod 111, 117, and 177 to some files and then ran "newperms". All three files were changed to 000 and all the other files on my system were set to world readable and writable. Also, it did not output what changed so I couldn't save the changes to a log file. edit: I just found another problem. MariaDB was not processing "custom.cnf". The log contained the following: Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored "newperms" had set "/mnt/cache/appdata/mariadb/custom.cnf" to 666 so "custom.cnf" was not getting processed. So I ran my script and restarted MariaDB. MariaDb processed "custom.cnf" and ran without errors. edit: Should I make a bug report for "newperms" or are these bugs already known?
  3. I made this script called "perms.sh" to fix my permissions: Edit: You must run the script as root. #!/bin/sh for dir in $(ls -1vd /mnt/cache /mnt/disk[0-9]*) do echo $dir chown -cR nobody:users $dir chmod -cR ug+rw,ug+X,o-rwx $dir done If you want to exclude the appdata directory then use this script: #!/bin/sh for dir in $(ls -1vd /mnt/cache/* /mnt/disk[0-9]*/*|grep -v "appdata") do echo $dir chown -cR nobody:users $dir chmod -cR ug+rw,ug+X,o-rwx $dir done perms.sh
  4. I believe you have more wrong other than file permissions, however, to fix your appdata permissions for Let's Encrypt and Nextcloud do the following: chown -cR nobody:users /mnt/user/appdata/letsencrypt /mnt/user/appdata/nextcloud chmod -cR ug+rw,ug+X,o-rwx /mnt/user/appdata/letsencrypt /mnt/user/appdata/nextcloud fixAppdataPerms.sh