Azure Managing Disk Space
Overview
In SFTP Gateway 2.001.00 and 2.001.01, we have identified an issues where the Linux disk can fill up over the course of a few weeks, if the server is under heavy load.
This article covers a workaround to keep disk usage under control.
Problem
The default size of a VM is 30 GB. Under light usage, this should be enough disk space.
The operating system and files for a default installation take up around 5 GB.
If the server is under heavy load, various log files can take up over 6 GB of storage, even when rotated. These logs include:
/var/log/messages
- LDAP logs
- Cron logs
Also, there is a folder /ts-tmp
that contains command-line output
for task spooler commands. There are a few processes that use the
task spooler.
This folder can grow indefinitely in size, because it's not a traditional log file managed by logrotate.
And under heavy load, the /ts-tmp
can use up the remainder of your
server storage within a matter of weeks.
Diagnosing and troubleshooting
To determine whether you are low on disk space, run the command:
sudo su
df -h
You should see the following output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 30G 26G 4.3G 86% /
To see how much of this storage is being taken up by /ts-tmp
, run
the following commands:
cd /ts-tmp
du -sh .
Cleaning up files
You can immediately clear out old files, using this command:
find /ts-tmp -mtime +1 -type f -exec rm {} \;
This will search for any files in the /ts-tmp
directory that are older
than a day, and then delete them.
To automate this process, you can run a daily scheduled task. Run this command:
sudo su
crontab -e
And append the following entry:
0 1 * * * find /ts-tmp -mtime +1 -type f -exec rm {} \; > /dev/null 2>&1
Once a day, this will delete /ts-tmp
files older than a day old.