Here are some of my favorite snippets for maintaining my CentOS Server.
Repair, test, and optimize all MySQL databases via SSH:
mysqlcheck --all-databases -r #repair mysqlcheck --all-databases -a #analyze mysqlcheck --all-databases -o #optimize
Get a listing of file sizes recursively to see if there are only a few files eating up disk space. Tested in CentOS 6:
du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf ("%6.1f\t%s\t%25s %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'
Find files older than X number of days and delete them. Remove the -delete to only list them. X number of days changed with the +7
find /folder/to/check/recursively -type f -mtime +7 -delete -print