Manual disk cleanup¶
No matter how large the hard drive is, the place on it will end sooner or later, if you don’t take preventive actions. It may result in the loss of the oldest data or even inoperability of the system.
To prevent this situation, estimate in advance the amount of required disk space considering the number of workstations, type of storaged content and storage period.
In the admin panel you can set the auto cleaning settings. In case this has not been done, or for some reason it does not work, you can manually clean the disk. To do this: Stop StaffCop by running this command
sudo service staffcop stop
If there is enough free space on the disk (check with the df -h command), it is enough to delete a) logs
sudo rm /var/log/*gz
old StaffCop databases
sudo staffcop cleanup X
where X is the number of days for which you want to keep data.
If the disc is almost filled, there may be problems with the deletion. In this case, there is a workaround to clean the disk.
sudo tune2fs -m 0 /dev/sdX
This command allows you to release the part of the disk reserved for system needs. After that, you need to perform the procedure for cleaning actions, described above. Then, you need to return to the superuser his reserve of disk space. To do this, run the following command:
sudo tune2fs -m 5 /dev/sdX
If this command is not executed and the settings are not correct, there is a possibility of occupying the entire hard disk, including 5% of the superuser.
Be sure to return the 5% reserve, 5% reserve is a commonly accepted practice.
After cleaning the disk, you need to start StaffCop anew with the command
sudo service staffcop start