Преглед на файлове

fix xdg user dir generation logic

remove auto-defrag and redirect find errors for disk maintenance
Casey DeLorme преди 5 години
родител
ревизия
502241bb0f
променени са 2 файла, в които са добавени 5 реда и са изтрити 16 реда
  1. 2 11
      arch.sh
  2. 3 5
      install/usr/local/bin/disk-maintenance

+ 2 - 11
arch.sh

@@ -213,17 +213,8 @@ if [[ -n "$username" && -n "$password" ]]; then
 	systemctl start postgresql
 	su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
 
-	# configure home directories
-	su $username -c "cd && mkdir -p ~/{desktop,downloads,templates,public,documents,music,pictures,videos,git} && xdg-user-dirs-update && update-desktop-database"
-	# su $username -c 'cd && xdg-user-dirs-update --set DESKTOP $HOME/desktop'
-	# su $username -c 'cd && xdg-user-dirs-update --set DOWNLOAD $HOME/downloads'
-	# su $username -c 'cd && xdg-user-dirs-update --set TEMPLATES $HOME/templates'
-	# su $username -c 'cd && xdg-user-dirs-update --set PUBLICSHARE $HOME/public'
-	# su $username -c 'cd && xdg-user-dirs-update --set DOCUMENTS $HOME/documents'
-	# su $username -c 'cd && xdg-user-dirs-update --set MUSIC $HOME/music'
-	# su $username -c 'cd && xdg-user-dirs-update --set PICTURES $HOME/pictures'
-	# su $username -c 'cd && xdg-user-dirs-update --set VIDEOS $HOME/videos'
-	# su $username -c 'cd && xdg-user-dirs-update'
+	# configure and generate xdg-user-dirs
+	su $username -c "cd && mkdir -p ~/{desktop,downloads,templates,public,documents,music,pictures,videos,git} && xdg-user-dirs-update"
 	update-desktop-database
 
 	# generate default (passwordless) ed25519 ssh key if none exists

+ 3 - 5
install/usr/local/bin/disk-maintenance

@@ -1,9 +1,9 @@
 #!/bin/bash
 
 # search and destroy garbage files in root
-find / -type f -iname "thumbs.db" -exec rm {} \; &
-find / -type f -iname ".ds_store" -exec rm {} \; &
-find / -type f -name '._*' -exec rm -rf {} \; &
+find / -type f -iname "thumbs.db" -exec rm {} \; 2> /dev/null &
+find / -type f -iname ".ds_store" -exec rm {} \; 2> /dev/null &
+find / -type f -name '._*' -exec rm -rf {} \; 2> /dev/null &
 
 # functions for asynchronous operations
 cleanup_ext4() {
@@ -26,8 +26,6 @@ cleanup_btrfs() {
 	btrfs balance start -musage=50 "$1"
 
 	btrfs scrub start -qdB "$1"
-
-	btrfs filesystem defragment -rfclzo "$1"
 }
 
 # defragment and fstrim ext4 weekly