Everything posted by JoeUnraidUser
-
Clean up command for folders under 10mb?
I know this is overkill, but it only took about 15 minutes. Here are 3 different scripts for different situations: Remove directories within a source directory over a certain size: #!/bin/bash limit=20G source="/mnt/user/Movies" 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 remove: $dir rm -rf "$dir" fi done removeDirOverSize.sh Remove files within a source directory over a certain size: #!/bin/bash limit=20G source="/mnt/user/Movies" find "$source" -type f -size +$limit -delete -print removeFilesOverSize.sh Remove files within a source directory over a certain size with specific extensions: #!/bin/bash limit=20G source="/mnt/user/Movies" find "$source" -regextype posix-extended -iregex '.*\.(mpg|mkv)' -size +$limit -delete -print To change extensions you could replace mpg|mkv with avi or mpg|mkv|avi etc... removeFilesOverSizeByExtension.sh
-
Clean up command for folders under 10mb?
I have to go out for dinner now, but I will write it up later on this evening. Are you looking to just delete .mpg and .mkv files or do you want to delete any file over 20GB? Do you just want the files removed or the whole directory?
-
Clean up command for folders under 10mb?
Glad you like the script, thanks.
-
Clean up command for folders under 10mb?
Here is a script that will remove directories within a source directory less than a certain size limit. I used 100M, but you can change it to any size in MB. The script can be easily changed to KB, GB, TB etc... Don't forget to set your source directory. #!/bin/bash limit=100M source="/mnt/user/Movies" limit=$(echo $limit | cut -d 'M' -f 1) for dir in "$source"/*/ do size=$(du -sBM "$dir" | cut -d 'M' -f 1) if (( $limit > $size )) then echo remove: $dir rm -rf "$dir" fi done removeDirUnderSize.sh
-
appdata permissions
When I copy and paste from now on, I will also attach a script with the code just to be safe.
-
appdata permissions
Lately, for some reason, copy and paste doesn't seem to work correctly for posting code. Sorry, I'm not sure how to fix the other problems.
-
appdata permissions
It doesn't equate to a number. I have attached the script that I use. fixAppdataPerms.sh
-
appdata permissions
Try it one more time. I repasted it.
-
appdata permissions
try it again. I repasted into the post for some reason there was a special character pasted in the code. 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
-
appdata permissions
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