MotivationWhen trying to put a file via SFTP or creating a remote directory via SFTP we were getting:
Couldn't write to remote file "filename": Failure Couldn't create directory: FailureIncreasing log level for SSH did not help to clarify the issue:
$sudo vi /etc/ssh/sshd_config ... # Logging SyslogFacility AUTH #LogLevel INFO LogLevel VERBOSE ... $ sudo service ssh restartHowever other user accounts did not show the issue. It ended up being related to the user quota in use where "used" was nearly the same as the "hard" setting:
sudo repquota -aThis simple POB script then can be used to check for certain percentage as explained. After getting the alert all the sysadmin will do is either delete files or increase quota:
sudo setquota -u user2 200000 200000 1500 1500 -a /It is a good idea to automatically delete of course old files if that is possible.