Turns out there is a program called autotrash that works under Ubuntu 16.04 LTS.
Here is an article that describes how it works:
Automatically Empty the Trash in Ubuntu
--> This article is informative but is older, so do not follow the install instructions.
Instead, just do this:
sudo apt-get update
sudo apt-get install autotrash
Then the program is executed by entering the autotrash command with arguments.
This can be run periodically by cron, and based on specific parameters:
Those arguments are described in detail in the
man page for autotrash for Ubuntu 16.04 LTS
EXCERPT:
NAME
autotrash — program to automatically purge old files from the trash
SYNOPSIS
autotrash [-d purge_n_days_old]
autotrash [--delete number_of_megabytes_to_purge]
autotrash [--keep-free number_of_megabytes_to_free]
DESCRIPTION
autotrash is a program that looks in a FreeDesktop.org Trash folder for
information on it's contents and then purges a part of the trash
depending on the options.
The most common option is -d, which will purge files that have been in
the trash for more then a given number of days.
The option --delete will remove at least the given number of megabytes
from the trash, removing the oldest trash first.
Using --keep-free will make sure at least the given number of megabytes
of free space is available, by automatically setting --delete to the
right value. For example, to keep at least a 1GB of free space,
removing files from the trash if needed, use autotrash --keep-free 1024
The man page goes on to describe many other options.