Creating a local mirror of datasets

The GMT website (Becoming a GMT mirror) gives a command for syncing/downloading the entire collection of datasets:

rsync -av --delete rsync://oceania.generic-mapping-tools.org/gmtdata /your/local/gmtdata

Say I did this, is there any way I can tell GMT to use this local copy (in /your/local/gmtdata), instead of connecting to a remote server?

Maybe setting GMT_DATA_SERVER to a local path?

I think you could directly download the dataset to your computer with gmt get.
From its docs:

To download all the Earth gridded products, leaving tiles as JP2000 files, try:

gmt get -Ddata=earth -N

Yes, looks like it. But if you download the tiles for a dataset, will GMT understand that you do have a local copy, and use that when doing e.g. gmt grdcut -RNO earth_relief_02m?

I did some testing of setting GMT_DATA_SERVER to a local path, but it does not seem like GMT (or rather curl?) accepts this, e.g.

$ gmt grdcut -RNO --GMT_DATA_SERVER='file=@/home/gmtdata' @earth_age_05m -Gtrash.nc
gmt [NOTICE]: Downloading dcw-countries.txt for the first time - be patient
gmt [ERROR]: Libcurl Error: URL using bad/illegal format or missing URL
gmt [ERROR]: Unable to obtain remote file dcw-countries.txt
gmt [WARNING]: gmt_get_dataset_tiles: No earth_age_05m_g tiles available for your region.
grdcut [NOTICE]: Downloading dcw-countries.txt for the first time - be patient
grdcut [ERROR]: Libcurl Error: URL using bad/illegal format or missing URL
grdcut [ERROR]: Unable to obtain remote file dcw-countries.txt
grdcut [ERROR]: Grid y range <= 0.0
grdcut (gmtapi_init_grdheader): Please select compatible -R and -I values
grdcut [ERROR]: Requested subset is entirely below or above the current grid region
$ gmt grdcut -RNO --GMT_DATA_SERVER='file:///home/gmtdata' @earth_age_05m -Gtrash.nc
gmt [NOTICE]: Downloading dcw-countries.txt for the first time - be patient
gmt [ERROR]: Libcurl Error: Could not resolve hostname
gmt [ERROR]: Unable to obtain remote file dcw-countries.txt
gmt [WARNING]: gmt_get_dataset_tiles: No earth_age_05m_g tiles available for your region.
grdcut [NOTICE]: Downloading dcw-countries.txt for the first time - be patient
grdcut [ERROR]: Libcurl Error: Could not resolve hostname
grdcut [ERROR]: Unable to obtain remote file dcw-countries.txt
grdcut [ERROR]: Grid y range <= 0.0
grdcut (gmtapi_init_grdheader): Please select compatible -R and -I values
grdcut [ERROR]: Requested subset is entirely below or above the current grid region

You only can use the name of the data server with this (Mirrors — The Generic Mapping Tools).
Run it once and then GMT will find it automatically.

According to GMT_DATA_SERVER, you can specify an URL as well.

I didn’t know that. Thanks.