#!/bin/sh ## ## SCRIPT: 01_fileCLeanup_AcerDesktop1_ver1_core.sh in $HOME/Rsync ## ## PURPOSE: This script is called by script ## '01_fileCLeanup_AcerDesktop1_ver1_RunCoreInTerminal.sh' ## to remove junk files --- especially files in the user's home ## directory --- such as ## - thumbnail files in $HOME ## and ## - leftover files in 'cache' and 'Crash Report' ## $HOME subdirectories of web browser(s). ## ## HOW TO USE: Typically used at computer shutdown, via a desktop icon, ## just before using a desktop icon to backup the home directory ## via an 'rsync' script. ## ## Created: 2019oct25 Based on similar cleanup scripts used on 'home-built'. ## Changed: 2019oct31 Add '-i' to 'rm' commands. ## Changed: 2019nov02 Removed '-i'. Put a 'read' statement before each 'rm' cmd. ## Echoed the 'rm' statement to be executed after each ## 'read' pause. ## Changed: 2021jan15 Split off the bottom 'LISTfiles' section into script ## 01_fileLISTcleanDirs_AcerDesktop1_ver1_core.sh ## Added '####..." above 'WILL REMOVE' echoes. ############################# ############################# ## 'CLEAN' SEAMONKEY files: ############################# ############################# ############ REMOVE SEAMONKEY ~/.mozilla 'Crash Reports' FILES ########### set - echo " ########################### Will REMOVE files under dir $HOME/.mozilla/seamonkey/Crash Reports/pending/ " set -x read PRESS_ANY_KEY_toContinue rm "$HOME/.mozilla/seamonkey/Crash Reports/pending/*" ## To get around problems caused by space in 'Crash Reports', ## putting quotes around just that subdir name WORKS. # rm $HOME/.mozilla/seamonkey/"Crash Reports"/pending/* ## THIS ALSO WORKS (escape the space): # rm $HOME/.mozilla/seamonkey/Crash\ Reports/pending/* ## WE COULD ALSO USE 'find' INSTEAD: # find "$HOME/.mozilla/seamonkey/Crash Reports/pending/" \ # -type f -name '*' -print -exec rm {} \; ## FOR TESTING: # read PRESS_ANY_KEY_toContinue # exit ########## REMOVE SEAMONKEY ~/.mozilla 'minidumps' FILES ############ set - echo " ########################### Will REMOVE files under dir $HOME/.mozilla/seamonkey/eynie5lc.default/minidumps/ " set -x read PRESS_ANY_KEY_toContinue rm -R $HOME/.mozilla/seamonkey/eynie5lc.default/minidumps/* ## MAYBE THE FOLLOWING IS NEEDED TOO --- to remove subdirs like ## https+++googleads.g.double.click.net and ## https+++www.wsj.com and https+++deals.dell.com # rm -R $HOME/.mozilla/seamonkey/eynie5lc.default/storage/default/* ## The following 'Cache.Trash*' files were used in a previous ## Seamonkey 2.10 version. # rm -R $HOME/.mozilla/seamonkey/eynie5lc.default/Cache.Trash* ## NO 'Cache.Trash*' files are used in Seamonkey 2.49.2. ################ REMOVE SEAMONKEY ~/.cache FILES #################### set - echo " ########################### Will REMOVE files under dir $HOME/.cache/mozilla/seamonkey/eynie5lc.default/cache2/entries/ " set -x read PRESS_ANY_KEY_toContinue rm -R $HOME/.cache/mozilla/seamonkey/eynie5lc.default/cache2/entries/* ## The following 'Cache' directory was used in a previous ## Seamonkey 2.10 version. # # rm $HOME/.mozilla/seamonkey/whatever.default/Cache/*/* # rm -R $HOME/.mozilla/seamonkey/whatever.default/Cache/* ## But NO such 'Cache' directory is used in Seamonkey 2.49.2. ## The Seamonkey 2.49.2 cache files seem to be under $HOME/.cache, ## NOT $HOME/.mozilla. ############################# ############################# ## 'CLEAN' FIREFOX files: ############################# ############################# ############ REMOVE FIREFOX ~/.mozilla 'Crash Reports' FILES ########### set - echo " ########################### Will REMOVE files under dir $HOME/.mozilla/firefox/Crash Reports/pending/ " set -x read PRESS_ANY_KEY_toContinue rm "$HOME/.mozilla/firefox/Crash Reports/pending/*" ## To get around problems caused by space in 'Crash Reports', ## putting quotes around just that subdir name WORKS. # rm $HOME/.mozilla/firefox/"Crash Reports"/pending/* ########## REMOVE FIREFOX ~/.mozilla 'minidumps' FILES ############ set - echo " ########################### Will REMOVE files under dir $HOME/.mozilla/firefox/7kxtmyvv.default/minidumps/ " set -x read PRESS_ANY_KEY_toContinue rm -R $HOME/.mozilla/firefox/7kxtmyvv.default/minidumps/* ## MAYBE THE FOLLOWING IS NEEDED TOO --- to remove subdirs like ## https+++googleads.g.double.click.net and ## https+++www.wsj.com and https+++deals.dell.com # rm -R $HOME/.mozilla/firefox/7kxtmyvv.default/storage/default/* ################ REMOVE FIREFOX ~/.cache FILES ####################### set - echo " ########################### Will REMOVE files under dir $HOME/.cache/mozilla/firefox/7kxtmyvv.default/cache2/entries/ " set -x read PRESS_ANY_KEY_toContinue rm -R $HOME/.cache/mozilla/firefox/7kxtmyvv.default/cache2/entries/* ## The following 'Cache' directory was used in a previous Firefox version. # rm $HOME/.mozilla/firefox/whatever.default/Cache/* ## NO 'Cache' directory used in Firefox 69.0.2. ## The Firefox 69.0.2 cache files seem to be under $HOME/.cache, ## NOT $HOME/.mozilla. ##################################### ##################################### ## 'CLEAN' Gnome/MATE THUMBNAIL files: ##################################### ##################################### ################ REMOVE 'normal' THUMBNAILS ##################### set - echo " ########################### Will REMOVE files under dir $HOME/.cache/thumbnails/normal/ " set -x read PRESS_ANY_KEY_toContinue ## For MATE 1.20.1: rm $HOME/.cache/thumbnails/normal/* ## For Gnome2, the following dir was used: # rm $HOME/.thumbnails/normal/* ################ REMOVE 'large' THUMBNAILS ##################### set - echo " ########################### Will REMOVE files under dir $HOME/.cache/thumbnails/large/ " set -x read PRESS_ANY_KEY_toContinue ## For MATE 1.20.1: rm $HOME/.cache/thumbnails/large/* ## For Gnome2, the following dir was used: # rm $HOME/.thumbnails/large/* ################ REMOVE 'fail' THUMBNAILS (gnome) ######################## set - echo " ########################### Will REMOVE files under dir $HOME/.cache/thumbnails/fail/gnome-thumbnail-factory/ " set -x read PRESS_ANY_KEY_toContinue rm $HOME/.cache/thumbnails/fail/gnome-thumbnail-factory/* ################ REMOVE 'fail' THUMBNAILS (mate) ####################### set - echo " ########################### Will REMOVE files under dir $HOME/.cache/thumbnails/fail/mate-thumbnail-factory/ " set -x read PRESS_ANY_KEY_toContinue rm $HOME/.cache/thumbnails/fail/mate-thumbnail-factory/* ####################################### ## CLEAN Macromedia/Adobe (flash) junk ## files as follows. Really obnoxious files. ####################################### ########### REMOVE Adobe/Macromedia 'Flash_Player' FILES ############# set - echo " ########################### Will REMOVE files under dir $HOME/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/ " set -x read PRESS_ANY_KEY_toContinue rm -R $HOME/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/* ## We may need to cleanup the following dir too. # rm -R $HOME/.macromedia/Flash_Player/\#SharedObjects/* ## The escaped '#' in '#SharedObjects' is needed to avoid removing ## 'Flash_Player', cause the '#' makes a comment of the following chars. ## We may need to cleanup the following dir too. # rm -R $HOME/.adobe/Flash_Player/AssetCache/* ################ END of CLEANUP ######################################## set - echo " ########################### END of files cleanup in dir $HOME " set -x read PRESS_ANY_KEY_toFinish