The “tmpwatch ” command in linux is to removes files which haven’t been accessed for a period of time. The tmpwatch recursively removes files which haven’t been accessed for a given time. Normally, it’s used to clean up directories which are used for temporary holding space such as /tmp.
If you are noticing “/tmp” getting overloaded with files and not sure which files/folders to delete – you better use “tmpwatch” to cleanup or delete files/folders from the “/tmp” directory.
You’ll need SSH root access to install tmpwatch and add it in the cron. If your server is inaccessible due to “/tmp” getting full – you may restart the server and that should free up some space after reboot.
Login to the server as root using SSH
Run the following command:
#yum install tmpwatch -y
To delete temporary files (for example after every 12 hours) run the following command:
#/usr/sbin/tmpwatch -am 12 /tmp
The next step is to configure tmpwatch to run automatically through a cron. To do that type the following command:
The above command will open the cron job list for the user root. Now go to the bottom and add the following line and save the file:
0 4 * * * /usr/sbin/tmpwatch -am 12 /tmp
If you are unable to add the above line, you may navigate to “/var/spool/cron” and open the cron file “root” with a text editor (such as, vi, nano). Add the line at the bottom and save the file:
0 4 * * * /usr/sbin/tmpwatch -am 12 /tmp
Check the usage of “/tmp” and it should be clean by now.
I always keep adequate space in the system Partition (most of the times “C” drive). Because, the empty space is required to store various system files or Temporary Application files. Not enough space on this partition can often slow down the computer. I had 50+ GB free space in this 100 GB partition and only till a couple of days back – when I discovered my C drive is running out of space.
I was a bit confused on what could take so much space all of a sudden. I checked the drive and found a folder named “Windows.old” occupying around 30 GB space. I know Windows.old folders are created when we re-install the Windows and don’t delete the old Windows files. But, in my case – this shouldn’t happen. Because, I haven’t re-installed Windows and this OS (Windows 10) is the one I have been using since I purchased my Laptop.
Finally, I discovered the folder Windows.old has been created by the Windows 10 itself after a recent update. It backed up the old version in windows.old folder. It is a safety mechanism implemented so that the system can roll back incase the update fails. The Folder is then retained so that we can roll back to previous version incase we face issue even after successful update.
Since my Windows 10 is running fine after the update – I don’t need that Windows.old folder anymore. Deleting it will give me 30 GB free space. I could have delete the folder right away. But, I thought I should first check what should be the proper way to delete this folder.
After spending some time researching I found I can delete this Windows.old folder in three ways.
1. How to Properly delete Windows.old folder from the Disk Cleanup option:
Right click on the System Drive (C drive in most of the cases) and click “Properties”.
Now Click on “Disk Cleanup”
Now click on “Cleanup System Files”
Now Select the option “Previous Windows installation(s) and finally press “OK”.
2. How to Properly delete Windows.old folder from Windows Storage Settings:
Go to Windows 10 settings by Clicking on Windows Start and the Setting icon.
Now Type in “Storage” and the option “Storage Settings” will appear. Click on “Storage Settings”.
NOW FOLLOW EITHER 2A OR 2B TO DELETE THE WINDOWS.OLD FOLDER.
2 A. Delete Windows.old folder using Storage Sense:
Click on “Change how we free up space automatically”.
Select the option “Delete previous versions of Windows” and finally click on “Clean Now”.
2 B. Delete Windows.old folder using Temporary Files Settings:
Go to the “Storage Settings” page. Click on “Free up space now”.
Select the option “Previous Windows Installation(s)” and finally click on “Remove Files”.
You can delete the Windows.old folder by any of the above three methods. But please be sure that – you no longer need it, your Windows 10 is functioning properly, You don’t need to roll back as all your applications are working fine and finally, you really need to free up space. Windows creates this Windows.old folder for some reasons and I have described that at the very beginning of the article. Feel free to share your views or suggestion (if any) through commenting.
HostGator is the largest shared hosting service provider in the whole world. There are good reasons for which millions of clients host there websites with HostGator. There service quality and support is superb and that is what set's them apart from others. Following are their Shared hosting packages:
Eleven2 is a US-based web hosting service with a global presence. It was founded in 2003 and its office address is in Los Angeles. Eleven2 offers two types of shared hosting - Shared hosting with Standard storage and Shared hosting with SSD. Eleven2's shared hosting packages are as follows:
Eleven2 Offers other services like: Reseller Hosting, SSD Reseller Hosting, Virtual Private Servers and Cloud Hosting.
Bluehost is a web hosting company owned by Endurance International Group. It is one of the 20 largest web hosts, collectively hosting well over 2 million. If you are looking for a good web hosting company, you have probably heard of Bluehost. They are a popular and quickly growing web hosting company.BlueHost's shared hosting packages are as follows:
iPageis a popular web hosting platform for a very big number of websites. It is one of those inexpensive hosting providers who provides quality hosting services with great support. iPage shared hosting packages are as follows:
iPage Offers other services like: Dedicated Hosting & VPS Hosting.
7upHost is global web hosting service provider operating from Bangladesh. Established in 2008 it has been serving clients from all over the world. They offer rock solid hosting with a friendly support. 7upHost shared hosting packages are as follows:
7upHost offers all kinds of web hosting besides shared hosting: SSD Hosting, Reseller Hosting, Virtual Private Server, Dedicated Server, Managed AWS Hosting, Google Cloud, GSuite and Professional Email Hosting services.
GreenGeeks is wellknown as an environment freidnly hosting service Provider. Their datacenters are powered by renewal energy sources. They are also reputed for their incredible hosting services and support. Their shared hosting packages are as follows:
GreenGeeks offers a variety of web hosting solutions, including shared hosting, reseller hosting, virtual private server hosting and dedicated Hosting.