Refresh Mail Dir Size in Cpanel

Often times I am finding myself wanting to know how much space is being used up by an account after deleting a bunch of items. CPanel is known for updating it every so often throughout the day, maybe every 4 hours or so but I don't really know. So as admin you are...

Restart a Node App via CRON Script

There are times that you are needing to run a cron job within a websites control panel that ensures the websites node app remains active if it stops for any reason.  Here is the little script that I used where the executables for node where within the bin directory...

Searching the Database Logs for Access Denied

So I recently needed to do a search of the database log files to see if there was any hosting accounts that were no longer connecting properly to their databases. Originally I did the following search: find /home -name “error_log” -exec grep -H...

Search and Replace in Files within Linux

Search files in current directory sed -i — ‘s/foo/bar/g' * perl -i -pe ‘s/foo/bar/g' ./* Recursive, regular files (including hidden ones) in this and all sub-directories find . -type f -exec sed -i ‘s/foo/bar/g' {} +...

Search content of files in Linux Shell

So by creating an executable file in /usr/bin will allow you to search recursively in a directory. I used it by creating a file called sfiles and when run it asks you for the content you are looking for.# Put in /usr/bin as an executable to allow use by any user...