Updated on Mar 16, 2018
In the last tutorial of these series, we provided you with the most common problems with different applications and their solutions in regards to the Inode count on your account. In this tutorial, we will be providing you with the best ways to avoid an exponential and unwanted increase in your Inode counts while maintaining your account healthy will also impact other resources like Disk Usage and Bandwidth as these three resources are inherently connected.
/public_html
folder, you are missing out on potential Inodes being freed for other uses. Make sure that you have a local copy of everything important in your hosting account and then remove these older backups via an FTP client or cPanel's File Manager.home/user/mail
folder of your account. There will be two folders called new and cur.It is very important that you do not remove the folders themselves and only delete the files inside due to the recreation process for these folders which can partially corrupt your hosting account environment.
&> /dev/null
or
>/dev/null 2>&1
The first will redirect the standard command output to the null device, which is a specifically made to discards the information which is sent to it, while the second will redirect the standard error stream to the standard output stream which prevents any output from the command being available.
Secondly, most commands utilize wget and curl which create a file with the output of the command in the home folder of your hosting account. Considering that Cron jobs can be run every few minutes, the number of files with output can flood your account fast. For example, if you have the following wget command:
5 * * * wget -O /dev/null -o /dev/null example.com
The -O
will send the downloaded file to /dev/null
, and the -o
will send the logs to /dev/null
.
A similar result can be achieved with:
5 * * * wget -O - mysite.com > /dev/null 2>&1
For curl
you can take a look at the following example:
1 1 * * 0 /usr/bin/curl --silent http://example.com/some.php &>/dev/null
If you still see a high amount of Inodes, you should check our Inode Usage tool in your cPanel and locate the Inode cluster, causing the issue. If there are no other files, which you can backup and remove, consider an upgrade as the shared hosting environment is limiting the growth of your website and business. Our VPS and Dedicated Server plans are just one click away in situations like that.