First, we can check old logs and how much data they contain.
/var/log/ → Standard location for system logs, and applications, unless a different location has been specified. Using ls -alh we can list all files, with their size, and with du -h we can see how large folders are. Sometimes, we do not need some archived old logs, so they can be deleted, but only if we are sure that they will not be needed anymore.
In /var/log/ there are some folders that can contain a large amount of logs. Example: /var/log/http/, which is a standard web server (in most cases, the Apache web server) logs location. In our example, the folder contains a lot of old logs (the ones with a date appended in the end of the file name) whose size is a few gigabytes. They can be deleted if we are sure that they will be no longer required.
Sample output of the ls -alh command (in /var/log/):
/servers/(cat/spell/pm)/logs → This is the location for XTM Cloud application logs, or the corresponding localization on your server, depending on the settings made during installation. Here we can also see files with a date appended at the end of the file name. As explained above, those files can be deleted if no longer required:
Sample output of the ls -lhcommand (in /servers/pm/logs):
Second, we move to XTM Cloud files:
We can check and delete files in temporary catalogs, if they have not been cleared automatically. There are many ways to do so, but the most efficient is to use a bash script and modify it to suit your needs. A good example of such a script is this one:
Bear in mind that the paths shown above are the standard installation paths for the XTM Cloud application. If you have different ones then edit it accordingly!
To create such a file, do as follows:
Create a file: vim clean_temp_xtm.sh.
Once in the program, press i and then paste the above content into the file.
Press Esc and the combined keystroke :wq to save and quit.
Add executable rights for a file: chmod +x clean_temp_xtm.sh;
Run the script: ./clean_temp_xtm.sh.
Lastly, we can delete archived or unused projects.
Only do so when you are sure that you will never need them again: when a project has been deleted, that cannot be undone!)
Go to /xtm/xtm/deleted/ or /xtm/xtm/archived (if you have a non-standard installation path, use your installation path(s) instead).
Inside this folder/those folders, you will find – the IDs of projects that have either been deleted or archived and you can choose which projects you can delete, if any.
Deleting database dumps
If you ever made some database dumps, there is a possibility that they were not deleted after the dump or restore.
Check your bash history to find out if some hints are there.
In the console, use history | grep -i 'pg_dump' – this command will list the bash history. It can be summarized as the pg_dump command.
You can then check the folder in which the dump was placed, and delete it if needed. If there is no pg_dump in bash history, you can always check if there are any unneeded leftover files in /servers/files/.