disk free space warning

When disk space is low, this code would produce an error instead of updating the database. This prevents zero disk space errors. The first version with `stat` command did not work for some reason, hence the python call.